View previous topic :: View next topic
|
Author |
Message |
annu zacson
New User
Joined: 19 Aug 2008 Posts: 15 Location: Cochin
|
|
|
|
I have an input file with the date field. The format is 20100303.
I need to write an output file with the content as below:
FILE NAME CONSUMER.XXXXXXXX.PGP , where XXXXXXXX is dynamic and will be fetched from the input file. The other values (in red) are always static and also need to be populated in the output file. Hope I'm clear. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this will do the trick, assuming the the output LRECL is 80
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
20100303.
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(C'FILE NAME CONSUMER.',1,8,C'.PGP',80:X)
/*
|
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If the Xs are supposed to contain the date from the input file, it could be used for a Windows/UNIX file, but that would be an invalid dataset name on the mainframe. |
|
Back to top |
|
|
annu zacson
New User
Joined: 19 Aug 2008 Posts: 15 Location: Cochin
|
|
|
|
Thanks Gerry..
This worked.. |
|
Back to top |
|
|
annu zacson
New User
Joined: 19 Aug 2008 Posts: 15 Location: Cochin
|
|
|
|
Hi,
Now i got one line in the output file as below:
FILE NAME CONSUMER.20100303.PGP
Is it possible to write one more line in the output file as below from the same input file.
FILE NAME CONSUMER.20100303.PGP
DATE OF REPORTING 20100303
Thanks |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
20100303.
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL OUTREC=(C'FILE NAME CONSUMER.',1,8,C'.PGP',/,
C'DATE OF REPORTING ',1,8,80:X)
|
Gerry |
|
Back to top |
|
|
annu zacson
New User
Joined: 19 Aug 2008 Posts: 15 Location: Cochin
|
|
|
|
Thanks Gerry..this worked.. |
|
Back to top |
|
|
|