Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Syncsort - Two SORT fields in one SORT card.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
janmejay
Warnings : 1

New User


Joined: 22 Jun 2007
Posts: 81
Location: bangalore

PostPosted: Wed Aug 29, 2012 7:07 pm    Post subject: Syncsort - Two SORT fields in one SORT card.
Reply with quote

I need to check two conditions in one sysin card, I have to look for a specific value at a position and if it satisfies I have to sort fields from X posn and if that value is not found at that position I have to sort it from Y position.
E.g. - If I get '13274' or '22026' at posn 19 then I have to sort the file from 1st posn and if not found I have sort from 19th posn- Below is the card I have used but I am getting Duplicate Statement error.

This is the card am using-

Code:
INREC IFTHEN=(WHEN=(19,10,CH,EQ,C'13274 ',OR,
                     19,10,CH,EQ,C'22026 '),OVERLAY=(25:C' '))
SORT FIELDS=(1,1,A,19,10,A,501,13,A,392,2,A,
488,8,A,499,1,A,54,8,A),FORMAT=BI
OPTION EQUALS
OUTREC IFTHEN=(WHEN=(19,10,CH,NE,C'13274 ',AND,
               19,10,CH,NE,C'22026 '),OVERLAY=(25:C' '))
SORT FIELDS=(19,10,A,1,1,A,501,13,A,392,2,A,
488,8,A,499,1,A,54,8,A)),FORMAT=BI   


Below is the error screen from spool-

Code:
 INREC IFTHEN=(WHEN=(19,10,CH,EQ,C'13274 ',OR,
                      19,10,CH,EQ,C'22026 '),OVERLAY=(25:C' '))
 SORT FIELDS=(1,1,A,19,10,A,501,13,A,392,2,A,
 488,8,A,499,1,A,54,8,A),FORMAT=BI
 OPTION EQUALS
 OUTREC IFTHEN=(WHEN=(19,10,CH,NE,C'13274 ',AND,
                19,10,CH,NE,C'22026 '),OVERLAY=(25:C' '))
 SORT FIELDS=(19,10,A,1,1,A,501,13,A,392,2,A,
 *
 488,8,A,499,1,A,54,8,A)),FORMAT=BI
WER269A SORT STATEMENT : DUPLICATE STATEMENT FOUND
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE   

Am using SORT.

Thanks in advance.!!!

Coded' - Anuj
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 29, 2012 7:24 pm    Post subject:
Reply with quote

Hello,

You can have only one SORT FIELDS per execution.

If you show some sample input data and the output you want when this sample data is processed, someone may have a suggestion.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Wed Aug 29, 2012 7:34 pm    Post subject: Reply to: Two SORT fields in one SORT card.
Reply with quote

A bit of judicious searching on this site but not this forum will get you to a recent similar requirement, with a solution which may or may not work for you, but should get you started at least.
Back to top
View user's profile Send private message
Dale Robertson

New User


Joined: 21 Jun 2013
Posts: 44
Location: U.S.A.

PostPosted: Wed Jun 26, 2013 2:28 am    Post subject: Simple is Better
Reply with quote

janmejay,

INREC IFTHEN=(WHEN=(19,10,CH,EQ,C'13274 ',OR,
19,10,CH,EQ,C'22026 '),OVERLAY=(25:C' '))

SORT FIELDS=(1,1,A,19,10,A,501,13,A,392,2,A,
488,8,A,499,1,A,54,8,A),FORMAT=BI
OPTION EQUALS

OUTREC IFTHEN=(WHEN=(19,10,CH,NE,C'13274 ',AND,
19,10,CH,NE,C'22026 '),OVERLAY=(25:C' '))

SORT FIELDS=(19,10,A,1,1,A,501,13,A,392,2,A,
488,8,A,499,1,A,54,8,A)),FORMAT=BI


Other than the obvious repeat of the SORT instruction, one thing you do that is a good thing is that you seem to understand how sort works - INREC then SORT then OUTREC. Although it's not necessary to code that way by doing so things become clearer and you can see your errors when you make them - which is what we do for a living when you think about it.

r

Bravo.
--Manko - For a Few Dollars More.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Wed Jun 26, 2013 3:07 am    Post subject: Reply to: Syncsort - Two SORT fields in one SORT card.
Reply with quote

1) Please "Green Screen" it, and use the Code Tags to preserve spacing. In the Code tags, the enhancement of text doesn't work (like Bolding) but life's like that at times...

2) Not certain, but I have half a feeling that the TS was trying to read and sort one file with INREC and a second with OUTREC.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us