Posted: Thu Jan 19, 2006 5:42 am Post subject: Need to pass month part to next step
Need help,
I have file, which I sorted and pickedup the records I wanted, and outreced the field I wanted to.
the output field contains a date field, I need to get just month part of it can I do it in one sort step. I have used:-
Now, When I use 33,2 in outrec, I pick up the value x'6011". PD0 then truncates the left most nibble (half byte) and right most nibble - which are '6' and '1' respectively, leaving just '01'.
Quote:
Also can I pass this value as a condition to next sort step
ex., include cond=(1,2,ch,eg,c'xx')
You can do this by using the sort card below.
Code:
//SYSIN DD *
SORT FIELDS=(5,2,CH,A,15,2,CH,A)
INCLUDE COND=((5,2,CH,EQ,C'BC'),AND,(15,2,CH,EQ,C'DC'))
SUM FIELDS=NONE
OUTREC FIELDS=(33,2,PD0,EDIT=(TTTT))
OUTFIL OUTREC=(c' INCLUDE COND=(1,2,CH,EQ,C''',1,2,C''')')
/*
You don't need OUTFIL OUTREC actually. But i have given so just for easy understanding.
Can I pass the packed decimal value itself instead of character, that way I can use that against a packed decimal month field on the second file in next sort step. Because the second file in the next sort step has a packed decimal month too.
Code:
//SYSIN DD *
SORT FIELDS=(5,2,CH,A,15,2,CH,A)
INCLUDE COND=((5,2,CH,EQ,C'BC'),AND,(15,2,CH,EQ,C'DC'))
SUM FIELDS=NONE
OUTREC FIELDS=(33,2)
OUTFIL OUTREC=(c' INCLUDE COND=(1,2,CH,EQ,C''',1,2,C''')')
/*
I tried to do some changes to the above step for the same, but I am getting INCLUDE COND=(7,2,PD,EQ,'01')
in first sort step I have
OUTFIL OUTREC=(C' INCLUDE COND=(7,2,PD,EQ,',33,2,PD,EDIT(TT),C')')
output is INCLUDE COND=(7,2,PD,EQ,01)
in 2nd sort step
SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(7,2,PD,EQ,01)
WER274A CONTINUATION STATEMENT ERROR FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
I got the value from previous step as 01 for January,
In the next sort step I have another file with date field, I want to get all the records from that file with same month as 01. this date field is also packed decimal field. So i am trying to
INCLUDE COND=(6,2,PD,EQ,01) but it is not working.
but it is not returning any records.
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