Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

Posted: Fri Jul 13, 2018 3:21 pm    Post subject: Adding comments in Synsort

Hello All,
I have some SYNCSORT statements; they work perfectly alright no problem at all. The below is the working statements.
 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=((23,1,CH,EQ,C'X',AND,          (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,          (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,           35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,           35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR,          (23,1,CH,EQ,C'R',AND,          (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,          (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR,          ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,                   (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J')))

I just want to add some comments and present in a very structured way so it’s very easy for someone to follow in future, there I am facing problem.

 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=( * MODEL 1.          (23,1,CH,EQ,C'X',AND,          (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,          (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,           35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,           35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR, * MODEL 2.          (23,1,CH,EQ,C'R',AND,          (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,          (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR, * MODEL 3.          ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,          (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J')) * END.         )   OUTFIL FNAMES=SORTREST,SAVE

It considers every statement as comment as below
 Code: SYSIN :   SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=(                                  * * MODEL 1. *          (23,1,CH,EQ,C'X',AND,          *          (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,          *          (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,          *           35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,           *            35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR,            *  * MODEL 2. *           (23,1,CH,EQ,C'R',AND,           *           (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,           *           (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           *            35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR,            *  * MODEL 3. *           ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,           *           (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J'))           * * END.     *          )          *    OUTFIL FNAMES=SORTREST,SAVE  WER268A  OUTFIL STATEMENT  : SYNTAX ERROR  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT  WER275A  NO KEYWORDS FOUND ON CONTROL STATEMENT

Regards
Rajiv R
Coded. Is the problem now obvious?

enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10700
Location: italy

 Posted: Fri Jul 13, 2018 3:30 pm    Post subject: wouldn' t it be simpler to READ the manual on how to include comments in the &sort control statements stream ?
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

 Posted: Fri Jul 13, 2018 3:33 pm    Post subject: It says add a * in position 1, • Identify a comment card image by placing an asterisk (*) in column 1. Comments can extend through column 80. which is what I did ,but for some reason (may be I am missing something) dint work and thats the reason posted to get other suggestion.
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10700
Location: italy

 Posted: Fri Jul 13, 2018 3:42 pm    Post subject: my wild guess is that comments - lines starting with an "*" - blank lines are allowed ONLY outside/between &sort control statements IIRC IBM SORT manuals are clear enough about it don' t know about syncsort
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

 Posted: Fri Jul 13, 2018 3:47 pm    Post subject: SYNCSORT manual says • Comment lines can be inserted between a control statement and its continuation by coding an asterisk (*) in column one. but somehow i am still successful.
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

 Posted: Fri Jul 13, 2018 3:48 pm    Post subject: sorry I meant,but somehow i am still not successful.
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1088
Location: Dublin, Ireland

 Posted: Fri Jul 13, 2018 5:26 pm    Post subject: you haven't 'coded' your controls cards so we can't see where the individual control cards actually start.... other than the comment lines, do they start in col 2 ?? Garry.
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

Posted: Fri Jul 13, 2018 6:05 pm    Post subject:

The perfectly working one

 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=((23,1,CH,EQ,C'X',AND,          (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,          (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,           35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,           35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR,          (23,1,CH,EQ,C'R',AND,          (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,          (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR,          ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,                   (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J')))
[/code]

The one causing problem
 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=( * MODEL 1.          (23,1,CH,EQ,C'X',AND,          (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,          (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,           35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,           35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR, * MODEL 2.          (23,1,CH,EQ,C'R',AND,          (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,          (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR, * MODEL 3.          ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,          (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J')) * END.         )   OUTFIL FNAMES=SORTREST,SAVE
[/code]
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1088
Location: Dublin, Ireland

 Posted: Fri Jul 13, 2018 6:08 pm    Post subject: No, that's not the coded format - see the buttons above where you're typing - one is "Code" (about centre) . Use that before and after the control statements. Then we'll be able to properly see what you're using. Garry.
rajiv rengasamy

New User

Joined: 24 Sep 2008
Posts: 26
Location: Chennai

 Posted: Fri Jul 13, 2018 6:18 pm    Post subject: I have put it in coded format in the above message its.Please refer to my earlier reply.
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2482
Location: @my desk

 Posted: Fri Jul 13, 2018 6:26 pm    Post subject: I don't have Syncsort, but I guess your problem is not even the comment lines. I am afraid the way it is written is going to fail even without the comment lines you inserted, because of your first INCLUDE=(.. and nothing coded after that. Similarly your last closing brackets by itself in a single line could be another problem. You should terminate your control statements after a comma and then continue on the next line. Alternatively you can also add comments by leaving one or more blanks after the last parameter or comma
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2482
Location: @my desk

Posted: Fri Jul 13, 2018 6:55 pm    Post subject:

And..use the L() expression to make it a bit more readable. This is UNTESTED.
 Code: OUTFIL FNAMES=SORTPLO,                                     INCLUDE=((23,1,CH,EQ,C'X',AND,               ** MODEL1                                       24,1,CH,EQ,L(C'F',C'L',C'S'),AND,                           35,1,CH,EQ,L(C'C',C'D',C'E',C'F',C'G',C'H')),OR,                                                                       (23,1,CH,EQ,C'R',AND,               ** MODEL2                                       24,1,CH,EQ,L(C'A',C'B'),AND,                               35,1,CH,EQ,L(C'W',C''X',C'Y',C'Z')),OR,                                                                                (23,1,CH,EQ,C'B',AND,               ** MODEL3                                       24,1,CH,EQ,C'A',AND,                                       35,1,CH,EQ,L(C'I',C'J')))
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Fri Jul 13, 2018 7:33 pm    Post subject:

rajiv rengasamy wrote:

The one causing problem
 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO,INCLUDE=( * MODEL 1.          (23,1,CH,EQ,C'X',AND,

OUTFIL ...INCLUDE=( cannot have any continuation line unless it ends with a comma.

1) RTFM
2) For syntax questions, GOTO Beginners Forum
steve-myers

Active Member

Joined: 30 Nov 2013
Posts: 859
Location: The Universe

 Posted: Fri Jul 13, 2018 10:16 pm    Post subject: Sergeyken - it appears to me the topic starter did RTFM. We do not know if it was read it correctly AND the manual was quoted correctly. But I think the real issue is comments can appear only between statements (or between the beginning of the data set and the first statement or (I'm guessing) between the last statement and the end of the data set). Anything else should be discussed with Syncsort support rather than this forum to either correct the product or (more likely) correct the manual.
Arun Raj

Moderator

Joined: 17 Oct 2006
Posts: 2482
Location: @my desk

 Posted: Sat Jul 14, 2018 12:02 am    Post subject: Hi Steve, I think (though I cannot test this), the manual has stated it correctly that the comment lines can be inserted by coding an asterisk(*) in column-1. The OP has used bad continuation, by stopping after the opening brackets where it can only be done after a parameter-comma or parameter-colon combination before column 72 (as per the MFX manual). The manual also states that a comment can be added by leaving one or more blanks after the last parameter or comma, and follow with the comment which can be extended through column 71.
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Sat Jul 14, 2018 7:32 pm    Post subject:

 steve-myers wrote: Sergeyken - it appears to me the topic starter did RTFM. We do not know if it was read it correctly AND the manual was quoted correctly. But I think the real issue is comments can appear only between statements (or between the beginning of the data set and the first statement or (I'm guessing) between the last statement and the end of the data set). Anything else should be discussed with Syncsort support rather than this forum to either correct the product or (more likely) correct the manual.

The real issue is extremely trivial: any SORT statement line, in order to be continued, must be truncated at any comma. NOT AT ANY OTHER CHARACTER.
There are thousands of typical examples in any of SORT manuals. That's why I suggested RTFM before appealing to the forum.
SORT comment lines can be inserted between ANY OF CORRECTLY CODED STATEMENT LINES, either they are continuations or not.
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Sat Jul 14, 2018 8:08 pm    Post subject: Re: Adding comments in Synsort

It is easier just to give the real solution rather than to explain the trivial errors...
 Code: SORT FIELDS=COPY   OUTFIL FNAMES=SORTPLO, * MODEL 1.       INCLUDE=(23,1,CH,EQ,C'X',AND,             (24,1,CH,EQ,C'F',OR,24,1,CH,EQ,C'L',OR,24,1,CH,EQ,C'S'),AND,             (35,1,CH,EQ,C'C',OR,35,1,CH,EQ,C'D',OR,              35,1,CH,EQ,C'E',OR,35,1,CH,EQ,C'F',OR,              35,1,CH,EQ,C'G',OR,35,1,CH,EQ,C'H')),OR, * MODEL 2.          (23,1,CH,EQ,C'R',AND,          (24,1,CH,EQ,C'A',OR,24,1,CH,EQ,C'B'),AND,          (35,1,CH,EQ,C'W',OR,35,1,CH,EQ,C'X',OR,           35,1,CH,EQ,C'Y',OR,35,1,CH,EQ,C'Z')),OR, * MODEL 3.          ((23,1,CH,EQ,C'B',AND,24,1,CH,EQ,C'A'),AND,          (35,1,CH,EQ,C'I',OR,35,1,CH,EQ,C'J'))) * END.   OUTFIL FNAMES=SORTREST,SAVE
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Mon Jul 16, 2018 6:17 pm    Post subject: Re: Adding comments in Synsort

If I had to do it then my own code might look like this
 Code: SORT FIELDS=COPY *   OUTFIL FNAMES=SORTPLO,      INCLUDE=((23,1,CH,EQ,C'X',                MODEL 1.           AND,(24,1,SS,EQ,C'FLS'),           AND,(35,1,SS,EQ,C'CDEFGH')),         OR,                                    MODEL 2.               (23,1,CH,EQ,C'R',           AND,(24,1,SS,EQ,C'AB'),           AND,(35,1,SS,EQ,C'WXYZ')),         OR,                                    MODEL 3.               (23,1,SS,EQ,C'BA',           AND,(35,1,SS,EQ,C'IJ'))) *   OUTFIL FNAMES=SORTREST,SAVE
Nic Clouston

Global Moderator

Joined: 10 May 2007
Posts: 2408
Location: Hampshire, UK

 Posted: Tue Jul 17, 2018 12:38 am    Post subject: Reply to: Adding comments in Synsort Going nowhere useful for the topic starter (TS) as s/he is obviously not listening. Locked. TS can pm me if s/he wants this unlocked so that s/he can give their thanks.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics DEBUG COMMENT command not adding to log Harold Barnes IBM Tools 1 Fri Apr 24, 2020 12:55 am Dynamically adding CLIST Library to e... upendrasri TSO/ISPF 12 Sat Mar 14, 2020 4:33 pm Compare input date as YYMMDD with the... Khurshid_Khan SYNCSORT 5 Fri Feb 21, 2020 10:28 pm Adding FIND to ISPF Panel display of ... Harold Barnes TSO/ISPF 3 Mon Oct 07, 2019 5:46 pm Need help in adding Header to records senthamizh SYNCSORT 1 Thu Mar 07, 2019 7:55 pm

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us