IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using Sort and include cond in single step


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Tue Apr 08, 2014 5:47 pm
Reply with quote

Hi.. i was trying to split a file based on some conditions using INCLUDE statement like below.(I am using syncsort 1.4.0 )
Code:

OPTION COPY                                                         
OUTFIL FILES=01,INCLUDE=(80,3,CH,EQ,C'A01')
OUTFIL FILES=02,INCLUDE=(80,3,CH,NE,C'A01')

Till this point its fine and simple.
however I am trying to SORT the files based on some fields as well in one shot using SORT FIELDS=(24,10,CH,A) along with include conditions.
This is not the correct way ,so getting syntax error. Tried like below also
Code:

OUTFIL FILES=02               
SORT FIELDS=(24,10,CH,A)     
INCLUDE COND=(80,1,CH,EQ,C'A')
                             
OUTFIL FILES=01               
SORT FIELDS=(12,1,CH,A)       
INCLUDE COND=(80,1,CH,NE,C'A')


But getting DUPLICATE STATEMENT FOUND.
Could you please suggest any way...!
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 08, 2014 6:18 pm
Reply with quote

Because you have duplicate SORT statements.

You can only have one SORT in a single step.

You can do one SORT and do the split, and SORT in another step for the second file. Or, especially with a lot of records, you can create an extra key, populated depending on your selection, and SORT on that key, to get both orders at once.
Back to top
View user's profile Send private message
rikdeb

New User


Joined: 19 Jan 2009
Posts: 63
Location: hyderabad

PostPosted: Tue Apr 08, 2014 6:25 pm
Reply with quote

Hi Bill.. Thanks for the clarification.!!.. Will do that...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
Search our Forums:

Back to Top