Fetching two different transaction from a single file

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Fetching two different transaction from a single file

Post by bputhirakond » Thu Jan 17, 2013 4:59 pm

Hi,

Can you tell me how to achieve this requierement in DFSort.

File contains a list of records with different transaction codes. However need to fetch only the transactions with transaction code of 24 followed by 64 or 26 followed by 64.

Thanks.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Fri Jan 18, 2013 1:58 am

Examples (both input and output), positions of key fields, lrecl recfm etc
Regards
Nic

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Mon Jan 21, 2013 1:44 pm

Hi Nic,

Please find the details:

Record format : FB
Record length : 200
Key Field(Trans-Code) Position : 162 (Length : 2)
_________________
Thanks
Bala

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Jan 21, 2013 3:23 pm

Where is the sample data that was requested?

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Wed Jan 23, 2013 1:45 pm

Hi,

Please find the sample data:
1)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 084055
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25086
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 1
20 DATE 5/PS 20120722
21 TIME 4/PS 93223
22 TRANS-CODE 2/PS 64

2)

14 TRAILER-REC 198/GRP
15 CODE 4/PS 074005
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25087
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 2
20 DATE 5/PS 20120722
21 TIME 4/PS 91213
22 TRANS-CODE 2/PS 24

3)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 073055
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25088
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 3
20 DATE 5/PS 20120722
21 TIME 4/PS 93213
22 TRANS-CODE 2/PS 64

4)

14 TRAILER-REC 198/GRP
15 CODE 4/PS 065345
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25089
18 SET-REF-NO 4/PS 718186
19 SET-SEQ-NO 4/PS 5
20 DATE 5/PS 20120722
21 TIME 4/PS 91818
22 TRANS-CODE 2/PS 9

Here Trans-Code is key value for this requirement.

Thanks
Bala

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Wed Jan 23, 2013 10:31 pm

Hello,

And where is the output wanted from that input?
Have a good one

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Wed Jan 23, 2013 11:19 pm

Hi,

Output file is same as input file length and same field structure.

Thanks
Bala

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Fri Jan 25, 2013 1:14 am

Hi,

Output file should be like below

1)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 084055
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25086
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 1
20 DATE 5/PS 20120722
21 TIME 4/PS 93223
22 TRANS-CODE 2/PS 64

2)

14 TRAILER-REC 198/GRP
15 CODE 4/PS 074005
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25087
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 2
20 DATE 5/PS 20120722
21 TIME 4/PS 91213
22 TRANS-CODE 2/PS 24

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Fri Jan 25, 2013 2:43 am

Please explain why those 2 "sets" of records were placed in the output file.

It is most unclear what the "rules" are.
Have a good one

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Sun Jan 27, 2013 11:11 pm

Hi

That's my requirement : Need to fetch the transactions with transaction code 24 followed by 64. So my output looks above. Can you help me to achieve this.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Mon Jan 28, 2013 2:49 am

You have not explained it clearly. Your first post says 24 or 26 followed by 64 but your output shows 64 followed by 24 and no sign of 26.
Regards
Nic

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Tue Jan 29, 2013 12:59 am

Sorry Nic, I have framed the wrong output. Please find the correct one.

14 TRAILER-REC 198/GRP
15 CODE 4/PS 074005
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25087
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 2
20 DATE 5/PS 20120722
21 TIME 4/PS 91213
22 TRANS-CODE 2/PS 24

3)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 073055
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25088
18 SET-REF-NO 4/PS 718184
19 SET-SEQ-NO 4/PS 3
20 DATE 5/PS 20120722
21 TIME 4/PS 93213
22 TRANS-CODE 2/PS 64

3)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 074010
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25089
18 SET-REF-NO 4/PS 718185
19 SET-SEQ-NO 4/PS 6
20 DATE 5/PS 20120725
21 TIME 4/PS 91215
22 TRANS-CODE 2/PS 26

4)
14 TRAILER-REC 198/GRP
15 CODE 4/PS 073056
16 SUBCODE 2/NUM 0
17 REF-NO 4/PS 25089
18 SET-REF-NO 4/PS 718188
19 SET-SEQ-NO 4/PS 6
20 DATE 5/PS 20120723
21 TIME 4/PS 93214
22 TRANS-CODE 2/PS 64

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Tue Jan 29, 2013 1:37 am

So your input is groups of 9 records, each group starting with a record like '14 TRAILER-REC...' and ending with a record like '22 TRANS-CODE...' and if the TRANS-CODE record says 24 or 26 then you want to output this group and the next group IF the next group's TRANS-CODE is 64?
Regards
Nic

bputhirakond
Member
Posts: 8
Joined: Thu Jan 17, 2013 4:51 pm

Post by bputhirakond » Wed Jan 30, 2013 2:53 pm

Hi Nic,

Yes, That's right.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Wed Jan 30, 2013 5:04 pm

From a Sort step, please post the ICE201I message.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others