balakrishna reddy Active User Joined: 13 Jul 2007 Posts: 130 Location: Guntur
I have a scenario where i need to give date field dynamically to the sort control statement.
i have input file with following records which have 1st 10 bytes as date.
now i have to pick up the records which have current date and write them in to one output file and the records which do not match the current date should be written to some other output file
now i want to take the records which have current date to one output file
and remaining to some other file.
for example if current date is 17/10/2007 then my first output file should have only 17/10/2007 and remaining records should written to second output file
i want this to be done using jcl sort.
thanks in advance!!
Frank Yaeger DFSORT Moderator Joined: 15 Feb 2005 Posts: 7130 Location: San Jose, CA
You can use a DFSORT job like this to do what you asked for:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD *
* Use system symbols to create a DFSORT symbol for:
//SYMNOUT DD SYSOUT=*
//SORTIN DD *
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SYSIN DD *
* Use the CURDATE symbol in INCLUDE.
For complete information on DFSORT's System Symbol String Constants function, see:
All times are GMT + 6 Hours