Now my problem here is that the Key values in the INPUT FILE 2 for example 'ao1' can repeat N number of times.For example if i add a record
"ao1 SHIFT : MORNING" in INPUT FILE 2 then the existing JOB will not be able to append 'SHIFT : MORNING' to 'ao1' key record in the OUTPUT FILE.
Everytime I have to add a condition like this
IFTHEN=(WHEN=(501,8,ZD,EQ,+5),BUILD=(1,3,95:7,20,501:501,16))
to handle this situation.
How can i avoid this? Can I change the column position and increment counter (bolded above) dynamically to avoid it? Or is there any other way.....please suggest
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
If you wanted to make it more automatic, you could have the job determine the maximum number of repetitions automatically and generate the corresponding WITH operands and IFTHEN clauses accordingly. But it would probably be easier to just code the WITH operands and IFTHEN clauses for the maximum number of repetitions you'd expect (e.g. 10).
If you wanted to make it more automatic, you could have the job determine the maximum number of repetitions automatically and generate the corresponding WITH operands and IFTHEN clauses accordingly.
Can you please explain the above mentioned quote by you with the help of some JOB code.....
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I don't know where the 'A45' etc in your output file comes from, but going with the DFSORT/ICETOOL job you show, here's how you could modify it to generate and use the correct number of WITH and IFTHEN clauses. If you want to see what I'm "generating", use DFSORT copy to display &&CTL2CNTL, &&WITH and &&IF.
CTL2CNTL :
OPTION COPY
OUTFIL FNAMES=WITH,REPEAT=01,
*
BUILD=(C' WITH(',SEQNUM,4,ZD,START=35,INCR=20,C',20)-',80:X)
OUTFIL FNAMES=IF,REPEAT=01,
*
BUILD=(C' IFTHEN=(WHEN=(501,8,ZD,EQ,',SEQNUM,2,ZD,START=2,
C'),BUILD=(1,3,',SEQNUM,4,ZD,START=35,INCR=20,
C':7,20,501:501,16)),',80:X)
WER428I CALLER-PROVIDED IDENTIFIER IS "0002"
WER903I SYNCSORT 1.2.1.0 IS NOT LICENSED FOR SERIAL 6FE80, TYPE 2096 X03,
WER903I SYNCSORT WILL STOP WORKING IN 39 DAYS UNLESS A VALID KEY IS INSTA
WER271A OUTFIL STATEMENT : NUMERIC FIELD ERROR
WER271A OUTFIL STATEMENT : NUMERIC FIELD ERROR
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
rajatbagga,
My job works fine with DFSORT. However, the WER messages indicate you're using Syncsort, not DFSORT.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
No problem Frank... You have already helped me a lot by giving your wonderfull idea for solving this problem, I will try to use this code with DFSORT... Thank you very much again