|
View previous topic :: View next topic
|
| Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
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 |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| 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 |
|
 |
Dale Robertson
New User

Joined: 21 Jun 2013 Posts: 44 Location: U.S.A.
|
|
|
|
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 |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|