kirankumarj
New User
Joined: 18 Dec 2007 Posts: 51 Location: delaware
|
|
|
|
Experts:
I have an output file from my program which looks like
Code: |
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 00001HEADER 20080409
000002 0000000000000000038762924 0 0 20080409 000003499642813800 DEBI
000003 0000000000000000038762975 0054790 20080409 000000948910953600 DEBI
000004 0000000000000000038762983 0556001 20080409 000000116843296600 DEBI
000005 0000000000000000038762991 0556004 20080409 000000122202339400 DEBI
000006 0000000000000000038763089 0 0 20080409 000000003372714900 DEBI
000007 0000000000000000038756364 0 0 20080409 000000185440641600 DEBI
000008 00001 200804090755110000487641275990000000000000000000
****** **************************** Bottom of Data ****************************
|
It is a 255 byte file. The final requirement is , I need to copy part of the trailer record,(identified by 00001) onto the Header Record .
Please let me know if you need any clarification . Thank you in Advance. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/255)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,5,CH,EQ,C'00001',AND,6,6,CH,NE,C'HEADER')
OUTREC BUILD=(C'TCON,''',21,40,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file (FB/255)
//SORTOUT DD DSN=... output file (FB/255)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=(1,11,CH,EQ,C'00001HEADER'),
OVERLAY=(21:TCON))
/*
|
|
|