MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Include Cond In Sort clarification

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
hchinnam
Beginner


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Fri Feb 20, 2009 5:48 am    Post subject: Include Cond In Sort clarification Reply with quote

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
View user's profile Send private message
hchinnam
Beginner


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Fri Feb 20, 2009 6:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Feb 20, 2009 11:03 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
hchinnam
Beginner


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Fri Feb 20, 2009 11:22 am    Post subject: Reply with quote

I thought INREC will get processed before include Question Question Question
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Fri Feb 20, 2009 11:27 am    Post subject: Reply with quote

hchinnam wrote:
I thought INREC will get processed before include Question Question Question


hchinnam,

You thought wrong. Check this link which explains in in detail about the order of processing in DFSORT

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.5.4

If you notice the control cards I posted , it follows the order of processing
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hchinnam
Beginner


Joined: 04 Feb 2005
Posts: 31
Topics: 10

PostPosted: Fri Feb 20, 2009 11:43 am    Post subject: Reply with quote

Thanks for the link. Thank You
Back to top
View user's profile Send private message
rk_pulikonda
Beginner


Joined: 27 May 2003
Posts: 22
Topics: 2
Location: India

PostPosted: Fri Feb 20, 2009 7:01 pm    Post subject: Reply with quote

Thank you Kolusu for the link. Laughing
_________________
Thanks
-Ram
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group