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 

DFSORT - Combining steps

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


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Tue Aug 23, 2011 9:43 am    Post subject: DFSORT - Combining steps Reply with quote

Gurus,

I would like to combine following 3 steps into one - is it possible?
(i.e., a single read of infile - not in multiple CTL statements)

SORT FIELDS=(1,10,CH,A,11,2,CH,D)
SELECT FROM(infile) TO(outfile) ON(1,10,CH) FIRST
INCLUDE COND=(20,1,CH,EQ,C'X')

Regards,
relaxing.
Back to top
View user's profile Send private message
Sqlcode
Intermediate


Joined: 15 Dec 2006
Posts: 157
Topics: 38

PostPosted: Tue Aug 23, 2011 10:08 am    Post subject: Reply with quote

relaxing,
Assuming LRECL of 80 for FB input file. See if below works(untested)...
Code:

SORT FIELDS=(1,10,CH,A,11,2,CH,D),EQUALS
OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,12),PUSH=(81:SEQ=8))
OUTFIL INCLUDE=(20,1,CH,EQ,C'X',AND,81,8,ZD,EQ,1),BUILD=(1,80)

Thanks,
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Aug 23, 2011 10:17 am    Post subject: Reply with quote

relaxing,

You are already using ICETOOL select so it is easy to combine all of them into 1 step like this . You don't have to worry about modifying the contents based on the lrecl.
Code:

//STEP0100 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         
//INFILE   DD *                                                 
1111111111AA       X                                           
1111111111CC       X                                           
1111111111ZZ       X   << SHOULD PICK THIS                     
1111111111BB       X                                           
2222222222ZZ       Y                                           
2222222222AA       X   << SHOULD PICK THIS                     
2222222222         X                                           
//OUTFILE  DD SYSOUT=*                                         
//TOOLIN   DD *                                                 
  SELECT FROM(INFILE) TO(OUTFILE) ON(1,10,CH) FIRST USING(CTL1)
//CTL1CNTL DD *                                                 
  INCLUDE COND=(20,1,CH,EQ,C'X')                               
  SORT FIELDS=(1,10,CH,A,11,2,CH,D)                             
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Tue Aug 23, 2011 10:32 am    Post subject: Reply with quote

Thanks Kolusu - that was great.
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