Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Tue Nov 30, 2004 11:21 pm Post subject:
Neostart,
Are you trying to divide the records in the input file to 4 different output files based on certain criteria ? As Kolusu said, Please give us a sample input and sample output that you are trying to achieve. Also provide the LRECL, RECFM of the input and output files. Also the expected/actual size of the file may also help (No. of records on an average).
1-2 - Country code
3-6 - Position held
7-8 - Salary Range
OUTFIL FILES=01,INCLUDE=((1,2,CH,EQ,C'US'),AND,(7,8,CH,EQ,C'HI'))
OUTFIL FILES=02,INCLUDE=(3,6,CH,EQ,C'ADMN')
AND SO ON...
- IT MAY BE POSSIBLE THAT RECORDS IN FILE01 MAY MATCH THE CONDITION IN FILE02.
- SO FEW RECORDS PRESENT IN BOTH FILES.
- REQUIREMENT: RECORDS ALREADY IN FILE=01 SHOULD NOT FALL IN FILE=02
- NOT SURE IS ,SAVE IS GOING TO HELP
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed Dec 01, 2004 11:40 am Post subject:
Well, of course the obvious way to do it is to use multiple DFSORT/ICETOOL COPY operators and just feed the remaining records to the next operator, but this will take multiple passes and be less efficient then if you could code all of the conditions in one pass as Kolusu suggested. Anyway, here's a DFSORT/ICETOOL job that shows the multiple pass method:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
US HI
US HI
US LO AA
US LO AB
LO AA
LO AB
ADMN
ADMN AA
ADMN AB
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//OUT3 DD SYSOUT=*
//OUT4 DD SYSOUT=*
//OUT5 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) USING(CTL1)
COPY FROM(T1) USING(CTL2)
COPY FROM(T2) USING(CTL3)
COPY FROM(T1) USING(CTL4)
/*
//CTL1CNTL DD *
OUTFIL FNAMES=OUT1,
INCLUDE=(1,2,CH,EQ,C'US',AND,7,8,CH,EQ,C'HI')
OUTFIL FNAMES=T1,SAVE
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT2,
INCLUDE=(3,6,CH,EQ,C'ADMN',AND,11,2,CH,EQ,C'AA')
OUTFIL FNAMES=T2,SAVE
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT3,
INCLUDE=(1,2,CH,EQ,C'US')
OUTFIL FNAMES=T1,SAVE
/*
//CTL4CNTL DD *
OUTFIL FNAMES=OUT4,
INCLUDE=(11,2,CH,EQ,C'AA')
OUTFIL FNAMES=OUT5,SAVE
/*
The output files would contain the following records:
OUT1
US HI
US HI
OUT2
ADMN AA
OUT3
US LO AA
US LO AB
OUT4
LO AA
OUT5
LO AB
ADMN
ADMN AB _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum