View previous topic :: View next topic
|
Author |
Message |
aditya_gorti
New User
Joined: 21 Dec 2005 Posts: 19
|
|
|
|
Hi,
I need to copy the date from the header record of the input file.
and append it at the end to every record of the output file.
Can we do it thru DFSORT..?
Please help me with that. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
aditya_gorti wrote: |
Can we do it thru DFSORT..? |
Probably.....
Quote: |
Please help me with that. |
Please help us by providing small examples of your input, output, lrecl and recfm..... |
|
Back to top |
|
|
aditya_gorti
New User
Joined: 21 Dec 2005 Posts: 19
|
|
|
|
Just adding some more details..
I have a header record and say "n" records in the input file.
So I need to copy all the "n" records from the input to output
file, as it is and take the date from header record of input file
and append it at the end of each of the "n" records in the output
file.
hope this will be some more help.
thanks,
Adi |
|
Back to top |
|
|
aditya_gorti
New User
Joined: 21 Dec 2005 Posts: 19
|
|
|
|
ok.. sure..
here u go with the details:
The inpu file is a sequential with recfm- FBA and lrecl - 81.
The date is from position 1 to 8 in the format "11/02/07".
The output needs to be with all the information what the input has
just by including the date "11/02/07" at the end of each record.
does this help..? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Do you want the header record in the output file?
Do you want the date from the header added in positions 82-89 of the output file?
Since this is an FBA input file, it has an ANSI carriage control character in position 1 (e.g. '1' for eject). So does the date in the header record really start at position 2? Do you want the output file to be FBA and include the ANSI carriage control character in each record, or do you want to drop the first byte and make the output FB?
It would really help if you would show an example of what the input records and expected output records look like (just a few records). |
|
Back to top |
|
|
aditya_gorti
New User
Joined: 21 Dec 2005 Posts: 19
|
|
|
|
The header record will look like :
cols:
(2-9) (30-52) (74-81)
10/30/07 XXXXXXXX PAGE 1
The records will look like following:
Cols:
(2-5) (12-20) (22-33) (58-81)
0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX
0003 123456789 ABCDEF XXXXX XXXXXXX
My records should look like :
Cols:
(2-5) (12-20) (22-33) (58-81) (83-90)
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
0003 123456789 ABCDEF XXXXX XXXXXXX AAAAAA
where AAAAAA is the date copied from the header.
Output file also needs to be in FBA format.
Please let me know if you need anything else..
Thanks
Adi |
|
Back to top |
|
|
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 file1 with date (FB/81)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(C'MYDATE,''',2,8,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file2 with records (FB/81)
//SORTOUT DD DSN=... output file (FB/90)
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(83:MYDATE)
/*
|
|
|
Back to top |
|
|
aditya_gorti
New User
Joined: 21 Dec 2005 Posts: 19
|
|
|
|
It's working! Thanks a lot!! |
|
Back to top |
|
|
|