From one of the program i got the output file having the following fields with values as
Name : paul
Merchant : More Inc
Tran Code : 263
Description : retailer
In the file it looks like as below
Code:
PAUL DOCKERS 101RETAILER
PAUL MOREINC 263RETAILER
CHRIS MOREINC 264RETAILER
STEEVE MOREINC 265RETAILER
COLIN MOREINC 266RETAILER
PAUL DOCKERS 301RETAILER
Now i want to read this file and for each tran code 263 with the same record with only change as trancode 63 similarly for TC264 a new record with TC64,similarly for TC265 a new record with TC58 and similarly for TC266 a new record with TC59, means the output file should be like as follows:
Code:
PAUL MOREINC 063RETAILER
CHRIS MOREINC 064RETAILER
STEEVE MOREINC 058RETAILER
COLIN MOREINC 059RETAILER
means the original file should not be rewritten with the above new tran codes, a new file should be created with the above details.
Could you please help me and provide me the code in ICETOOL / DFSORT.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
PAUL DOCKERS 101RETAILER
PAUL MOREINC 263RETAILER
CHRIS MOREINC 264RETAILER
STEEVE MOREINC 265RETAILER
COLIN MOREINC 266RETAILER
PAUL DOCKERS 301RETAILER
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'263',OR,
1,80,SS,EQ,C'264',OR,
1,80,SS,EQ,C'265',OR,
1,80,SS,EQ,C'266')
INREC FINDREP=(INOUT=(C'263',C'063',C'264',C'064',
C'265',C'058',C'266',C'059'))
/*
my requirement is some what different. I am explaining again as follows:
My file length is 458 bytes and it's record format is FB. The following is the layout of the fields. ( i cannot provide the entire layout so the remaining fields as mentioned with dots and the last filed is shown after dots).
FILLER :GQPT:-MT-EFF-DATE :GQPT:-MT-TYPE :GQPT:-MT-TXN-CODE ........ FILLER
31/AN 4/PS 1/AN 2/PS 32/AN
(1-31) (32-35) (36-36) (37-38) (427-458)
1------------------------------ 2----------------- 3--------------------4----------------- ........----14-------
********************************* TOP OF DATA **********************-CAPS OFF-*
470000000000612000004400000471M 2010093 D 123
470000000000612000004400000471M 2010093 D 263
470000000000612000004400000471M 2010093 D 264
470000000000612000004500000471M 2010093 D 263
Now i would like to create an output file by reading the above input file where the transaction code which is a packed decimal 263 will be included and the output record should contain the same record of the input record with only difference will be the transaction code 263 should be changed to 63. The output file should contain the following record.
Code:
FILLER :GQPT:-MT-EFF-DATE :GQPT:-MT-TYPE :GQPT:-MT-TXN-CODE ......... FILLER
31/AN 4/PS 1/AN 2/PS 32/AN
(1-31) (32-35) (36-36) (37-38) (427-458)
1------------------------------ 2----------------- 3--------------------4----------------- .........----14--
********************************* TOP OF DATA **********************-CAPS OFF-*
470000000000612000004400000471M 2010093 D 63
470000000000612000004500000471M 2010093 D 63
Please help me to achieve this using ICETOOL / DFSORT. Thanks in advance
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
S999 is NOT packed decimal - it's zoned decimal. Packed decimal would be S999 COMP-3. Since you have the transaction code in positions 37-38, it obviously can't be a 3-byte ZD value, so I'll assume it's a 2-byte PD value. If so, you can use a DFSORT job like this:
Thanks a lot, it's working fine. As you assumed that the tran code is a S999 comp-3 field , the above layout was shown from the file-Aid. The below is from the record layout.