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 SELECT Syntax Error - help

 
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 Dec 21, 2010 5:51 pm    Post subject: DFSORT SELECT Syntax Error - help Reply with quote

Hello,
I am sure I am using right syntax but am unable to understand why it is failing with syntax error. Can you help me out please?

Code:

//STEP0002 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD  SYSOUT=*                                         
//DFSMSG   DD  SYSOUT=*                                         
//INFILE1  DD DISP=SHR,DSN=FILE1.STEP0002       
//OUTFIL1  DD DSN=EDGER.OUTFIL1,                               
//            DCB=(RECFM=FB,LRECL=72,BLKSIZE=0),                 
//            DISP=(,CATLG,DELETE),                             
//            SPACE=(CYL,(1,1),RLSE)                             
//OUTFIL2  DD SYSOUT=*                                           
//TOOLIN DD  *                                                   
  SELECT FROM(INFILE1) TO(OUTFIL1) ON(15,14,CH) FIRST USING(CTL1)
  SELECT FROM(INFILE1) TO(OUTFIL2) ON(01,14,CH) ON(128,18,CH) - 
  FIRST USING(CTL2)                                             
/*                                                               
//CTL1CNTL DD *                                                 
  OUTFIL FNAMES=OUTFIL1,                                         
  INCLUDE=(1,1,CH,NE,C'H',AND,                                   
                1,1,CH,NE,C'U',AND,                             
                1,1,CH,NE,C'E',AND,   
                1,1,CH,NE,C'X')       
  OUTREC=(15,14,72:X)                 
/*                                     
//CTL2CNTL DD *                       
  OUTFIL FNAMES=OUTFIL2,               
  INCLUDE=(1,1,CH,NE,C'H',AND,         
                1,1,CH,NE,C'U',AND,   
                1,1,CH,NE,C'E',AND,   
                1,1,CH,NE,C'X')       
  OUTREC=(15,14,128,18,72:X)           
/*


Error Message:

[code:1:885f6395fa]
ICE000I 0 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 22:40 ON TUE DE
OUTFIL FNAMES=OUTFIL1,
INCLUDE=(1,1,CH,NE,C'H',AND,
1,1,CH,NE,C'U',AND,
1,1,CH,NE,C'E',AND,
1,1,CH,NE,C'X')
OUTREC=(15,14,72:X)
Back to top
View user's profile Send private message
relaxing
Beginner


Joined: 25 Aug 2003
Posts: 73
Topics: 29

PostPosted: Tue Dec 21, 2010 5:57 pm    Post subject: Reply with quote

Sorry I found it - it was a missing 'comma' before OUTREC statement.
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 Dec 21, 2010 6:09 pm    Post subject: Reply with quote

relaxing,

Your Second select statement does not make any sense, you are selecting the records validating the contents at pos 1 for 14 bytes and pos 128 for 18 bytes. But when writing out you are picking the contents from pos 15 for 14 bytes. Is that what you really want?

And You can simplify your code with the following. I am just showing you the first select statement. Always test for positive conditions instead of negative conditions. You only want to pick records other than records which have H, U, E and X , so use them in OMIT condition. Since you are interested in picking just the contents from pos 15 and padding the rest with spaces , we actually trim down the input to just 14 bytes and sort it.
Code:

//TOOLIN DD  *                                                   
  SELECT FROM(INFILE1) TO(OUTFIL1) ON(01,14,CH) FIRST USING(CTL1)
/*                                                               
//CTL1CNTL DD *                                                 
  OMIT COND=(1,1,SS,EQ,C'H,U,E,X')   
  INREC BUILD=(15,14)
  OUTFIL FNAMES=OUTFIL1,OVERLAY=(72:X)
//*


PS: You need to use code instead of quote
_________________
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 Dec 21, 2010 6:22 pm    Post subject: Reply with quote

Kolusu, thanks for pointing out..I was concentration on the first and did not look at the second - but I noticed once I had fixed the first issue. Sorry for the confusion..
And thanks for the additional comments. I will introduce OMIT as you suggested.
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