View previous topic :: View next topic
Author
Message
trushant.w New User Joined: 22 Sep 2013Posts: 81 Location: pune india
Im using below sort card
Code:
//TOOLIN DD *
COPY FROM(SORTIN1) TO(T1,T2) USING(CTL1)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,
INCLUDE=(39,04,CH,EQ,C'ONUS')
SORT FIELDS=(214,1,CH,A)
INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4')),
IFTHEN=(WHEN=NONE,OVERLAY=(214:C'5'))
*
OUTFIL FNAMES=T2,
INCLUDE=(39,04,CH,EQ,C'NOUS')
SORT FIELDS=(214,1,CH,A,215,1,CH,A)
INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT)
IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT)
Input file 213 bytes
T1 214 bytes
T2 215 bytes
But i am getting below error
Code:
OUTFIL FNAMES=T2,
INCLUDE=(39,04,CH,EQ,C'NOUS')
SORT FIELDS=(214,1,CH,A,215,1,CH,A)
ICE002I 0 DUPLICATE OR CONFLICTING SORT STATEMENT
INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),
ICE002I 0 DUPLICATE OR CONFLICTING INREC STATEMENT
IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=N
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
Second dort is for t2 file but still its showing above error
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
Hi,
The error is pretty clear
You are having duplicate INREC and SORT statements
If you could explain what you are trying to do we could assist you
Back to top
trushant.w New User Joined: 22 Sep 2013Posts: 81 Location: pune india
I want to create two output files based on above sort cards
But as the input data is very large i want to read input only once
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
You would need 2 CTLxx cards just because of your SORT FIELDS atleast
Ignore my comment above: Why do you need sort for 215,1 ??
Back to top
trushant.w New User Joined: 22 Sep 2013Posts: 81 Location: pune india
i need to data sorted by fist key( pos 214) and then by second key (pos 215) for second output file.
But if we use two control cards then we would have to read file twice
and i want to read input only once
Back to top
Pandora-Box Global Moderator Joined: 07 Sep 2006Posts: 1592 Location: Andromeda Galaxy
To my knowledge to achieve your requirement is not possible in one pass
Lets see what Bill/Kolusu has for you
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
trushant.w wrote:
I want to create two output files based on above sort cards
But as the input data is very large i want to read input only once
trushant.w,
First things first. Your Syntax is NOT valid. You are complicating a simple request. If your intention is to SORT the values 5525,5526,5122,5513 in that order it is quite easy . It doesn't matter what you have at position 39 as you are splitting the input file into 2 different files.
Back to top
trushant.w New User Joined: 22 Sep 2013Posts: 81 Location: pune india
Thanks for you inputs.
Based on position 39, my requirement is to create two output files
Output1:- Will be Sorted on only one Key which is at pos 39
Output2:- Will be Sorted on Key at pos 39 and at pos 44 (not pasted entire sort card above).
This requirement works fine when i use two sort card and read the input twice.
BUt as the input is very large i want to read input file only once and created the above mentioned files in one go.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
So you have two, working, steps which use the same input and you want to combine them into one step?
Please show both working steps.
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
trushant.w wrote:
Thanks for you inputs.
Based on position 39, my requirement is to create two output files
Output1:- Will be Sorted on only one Key which is at pos 39
Output2:- Will be Sorted on Key at pos 39 and at pos 44 (not pasted entire sort card above).
You expect us to provide you a 1 step solution reading your mind? As bill asked show us the complete sort control cards and may be we can suggest an alternative.
Back to top
trushant.w New User Joined: 22 Sep 2013Posts: 81 Location: pune india
Input File is 214 bytes
Here are my Two sort cards
Code:
INCLUDE COND=(39,04,CH,EQ,C'ONUS')
SORT FIELDS=(214,1,CH,A)
* IFTHEN=(WHEN=INIT,OVERLAY=(214:C'5')),
INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4')),
IFTHEN=(WHEN=NONE,OVERLAY=(214:C'5'))
Code:
INCLUDE COND=(39,04,CH,EQ,C'NOUS')
SORT FIELDS=(214,1,CH,A,215,1,CH,A)
INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT),
*
IFTHEN=(WHEN=((44,06,ZD,LE,060066),
OR,(44,06,ZD,GE,063968,AND,44,06,ZD,LE,099999)),
OVERLAY=(215:C'1')),
*
IFTHEN=(WHEN=(44,06,ZD,GE,200000,AND,44,06,ZD,LE,299999),
OVERLAY=(215:C'2')),
IFTHEN=(WHEN=((44,06,ZD,GE,100000,AND,44,06,ZD,LE,101608),
OR,(44,06,ZD,GE,100000,AND,44,06,ZD,LE,101609),
OR,(44,06,ZD,GE,101709,AND,44,06,ZD,LE,170205),
OR,(44,06,ZD,GE,170306,AND,44,06,ZD,LE,199999)),
OVERLAY=(215:C'3')),
IFTHEN=(WHEN=((44,06,ZD,GE,300000,AND,44,06,ZD,LE,349999),
OR,(44,06,ZD,GE,420000,AND,44,06,ZD,LE,429999),
OR,(44,06,ZD,GE,500000,AND,44,06,ZD,LE,569999),
OR,(44,06,ZD,GE,620000,AND,44,06,ZD,LE,659999)),
OVERLAY=(215:C'4')),
IFTHEN=(WHEN=(44,06,ZD,GE,350000,AND,44,06,ZD,LE,350999),
OVERLAY=(215:C'5'))
Back to top
Skolusu Senior Member Joined: 07 Dec 2007Posts: 2205 Location: San Jose
Your Initial post says the LRECL is 213 and now you say the LRECL is 214. what is the correct LRECL? I assumed the LRECL to be 213.
Try this untested sort card.
Code:
//SYSIN DD *
INCLUDE COND=(39,04,SS,EQ,C'ONUS,NOUS')
INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT),
IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT),
IFTHEN=(WHEN=(39,4,CH,EQ,C'ONUS'),OVERLAY=(215:X),HIT=NEXT),
IFTHEN=(WHEN=((39,4,CH,EQ,C'NOUS',AND,44,06,ZD,LE,060066),OR,
(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,063968,AND,44,06,ZD,LE,099999)),
OVERLAY=(215:C'1')),
IFTHEN=(WHEN=(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,200000,AND,44,06,ZD,LE,299999),
OVERLAY=(215:C'2')),
IFTHEN=(WHEN=((39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,100000,AND,44,06,ZD,LE,101608),
OR,(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,100000,AND,44,06,ZD,LE,101609),
OR,(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,101709,AND,44,06,ZD,LE,170205),
OR,(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,170306,AND,44,06,ZD,LE,199999)),
OVERLAY=(215:C'3')),
IFTHEN=(WHEN=((39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,300000,AND,44,06,ZD,LE,349999),
OR,(39,4,CH,EQ,C'NOUS',AND,
(44,06,ZD,GE,420000,AND,44,06,ZD,LE,429999),
OR,(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,500000,AND,44,06,ZD,LE,569999),
OR,(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,620000,AND,44,06,ZD,LE,659999)),
OVERLAY=(215:C'4')),
IFTHEN=(WHEN=(39,4,CH,EQ,C'NOUS',AND,
44,06,ZD,GE,350000,AND,44,06,ZD,LE,350999),
OVERLAY=(215:C'5'))
SORT FIELDS=(214,1,CH,A,215,1,CH,A)
OUTFIL FNAMES=T1,INCLUDE=(39,4,CH,EQ,C'ONUS'),BUILD=(1,213)
OUTFIL FNAMES=T2,INCLUDE=(39,4,CH,EQ,C'NOUS'),BUILD=(1,213)
Back to top
Please enable JavaScript!