MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
hchinnam Beginner Joined: 04 Feb 2005 Posts: 31 Topics: 10
Posted: Fri Feb 20, 2009 5:48 am Post subject: Include Cond In Sort clarification
All,
I wrote a control card that looks like below,
Code:
SORT FIELDS=(27,4,ZD,A)
INCLUDE COND=(27,4,CH,GE,C'0300',AND,
27,4,CH,LE,C'0701')
INREC FIELDS=(1,4,C' ',33,16,C' ',368,5,PD,TO=ZD,LENGTH=8,C' ',21,4)
OUTFIL FNAMES=SORTOUT,VTOF,BUILD=(1,35)
It returns me no records (but i was expecting some records).
So I have split the control cards in to two, and ran in two saparate JOBs
first one job has a control card
Code:
SORT FIELDS=(27,4,ZD,A)
INREC FIELDS=(1,4,C' ',33,16,C' ',368,5,PD,TO=ZD,LENGTH=8,C' ',21,4)
OUTFIL FNAMES=SORTOUT,VTOF,BUILD=(1,35)
second one, with the following control card
Code:
SORT FIELDS=COPY
INCLUDE COND=(27,4,CH,GE,C'0300',AND,
27,4,CH,LE,C'0701')
Now it has returned the data as i was expecting.
Can some one explain, why it is happening so. For me both looks same.
Back to top
hchinnam Beginner Joined: 04 Feb 2005 Posts: 31 Topics: 10
Posted: Fri Feb 20, 2009 6:30 am Post subject:
Found it,
Code:
SORT FIELDS=(27,4,ZD,A)
INREC FIELDS=(1,4,C' ',33,16,C' ',368,5,PD,TO=ZD,LENGTH=8,C' ',21,4)
OUTFIL FNAMES=SORTOUT,VTOF,BUILD=(1,35),
INCLUDE=(27,4,CH,GE,C'0300',AND,
27,4,CH,LE,C'0701')
did the trick.
But still can't understand what
Code:
SORT FIELDS=(27,4,ZD,A)
INCLUDE COND=(27,4,CH,GE,C'0300',AND,
27,4,CH,LE,C'0701')
INREC FIELDS=(1,4,C' ',33,16,C' ',368,5,PD,TO=ZD,LENGTH=8,C' ',21,4)
OUTFIL FNAMES=SORTOUT,VTOF,BUILD=(1,35)
does.
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Fri Feb 20, 2009 11:03 am Post subject:
hchinnam ,
Quite simple . Your Input is a VB file and you did not account for the RDW (4 bytes) . So the actual positions of the include field is 31.
The second case worked because you converted the VB file to FB file which does NOT have the RDW.
use the following control cards . I assumed that you did not account for RDW on all the fields in your INREC card too
Code:
//SYSIN DD *
INCLUDE COND=(31,4,CH,GE,C'0300',AND,31,4,CH,LE,C'0701')
INREC FIELDS=(1,4,C' ',37,16,C' ',372,5,PD,TO=ZD,LENGTH=8,C' ',25,4)
SORT FIELDS=(27,4,ZD,A)
OUTFIL VTOF,BUILD=(1,35)
/*
_________________ Kolusu
www.linkedin.com/in/kolusu Last edited by kolusu on Fri Feb 20, 2009 7:42 pm; edited 1 time in total
Back to top
hchinnam Beginner Joined: 04 Feb 2005 Posts: 31 Topics: 10
Posted: Fri Feb 20, 2009 11:22 am Post subject:
I thought INREC will get processed before include
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Back to top
hchinnam Beginner Joined: 04 Feb 2005 Posts: 31 Topics: 10
Posted: Fri Feb 20, 2009 11:43 am Post subject:
Thanks for the link.
Back to top
rk_pulikonda Beginner Joined: 27 May 2003 Posts: 22 Topics: 2 Location: India
Posted: Fri Feb 20, 2009 7:01 pm Post subject:
Thank you Kolusu for the link. _________________ Thanks
-Ram
Back to top
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