View previous topic :: View next topic
Author
Message
jobin thomas New User Joined: 19 Aug 2008Posts: 15 Location: Bangalore
Hi,
Input File to be sorted:
Code:
20080731 XXXXXXXXX
20080825 XXXXXXXXX
20080826 XXXXXXXXX
20080827 XXXXXXXXX
20080828 XXXXXXXXX
20080829 XXXXXXXXX
20080830 XXXXXXXXX
20080831 XXXXXXXXX
20080901 XXXXXXXXX
....
Condition file:
Code:
XXXXX 20080830 XXXXXXXXXX
I would pick the month (i.e., 08 ) from the condition file and sort the input file. ie., the sorted output should have only details for August.
Sorted Output:
Code:
20080825 XXXXXXXXX
20080826 XXXXXXXXX
20080827 XXXXXXXXX
20080828 XXXXXXXXX
20080829 XXXXXXXXX
20080830 XXXXXXXXX
20080831 XXXXXXXXX
I am not sure, but is there any way we can pass the MM value from condition file as INCLUDE condition to sort the input file???
Or there is some other way to do it?
Back to top
jobin thomas New User Joined: 19 Aug 2008Posts: 15 Location: Bangalore
The value '08' (august month) is to come from the condition file. And using this value I would sort my input file.
Code:
INCLUDE COND=(5,2,CH,EQ,'08')
The value '08' has to come from another file (named condition file)....
Is there any way to do that using JCL Utilities.
Last option will be to write an easytrieve or COBOL.
Back to top
jobin thomas New User Joined: 19 Aug 2008Posts: 15 Location: Bangalore
LRECL and date position are actually different.
Input File length : 150 [Date field for MM at position 30]
Condition File length: 150 [Date field for MM at position 30 and it has got just one record]
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 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=... condition file (FB/150)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN DD *
OPTION COPY
* Create DFSORT Symbol for month as:
* TMON,'mm'
INREC BUILD=(C'TMON,''',30,2,C'''',80:X)
/*
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file (FB/150)
//SORTOUT DD DSN=... output file (FB/150)
//SYSIN DD *
* Use TMON symbol in INCLUDE statement.
INCLUDE COND=(30,2,CH,EQ,TMON)
SORT FIELDS=(26,8,CH,A)
/*
Back to top
Please enable JavaScript!