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

Adding comments in Synsort


IBM Mainframe Forums -> SYNCSORT
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 3:21 pm
Reply with quote

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?
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10713
Location: italy

PostPosted: Fri Jul 13, 2018 3:30 pm
Reply with quote

wouldn' t it be simpler to READ the manual on how to include comments in the &sort control statements stream ?
Back to top
View user's profile Send private message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 3:33 pm
Reply with quote

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.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10713
Location: italy

PostPosted: Fri Jul 13, 2018 3:42 pm
Reply with quote

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
Back to top
View user's profile Send private message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 3:47 pm
Reply with quote

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.
Back to top
View user's profile Send private message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 3:48 pm
Reply with quote

sorry I meant,but somehow i am still not successful.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Fri Jul 13, 2018 5:26 pm
Reply with quote

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.
Back to top
View user's profile Send private message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 6:05 pm
Reply with quote

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]
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Fri Jul 13, 2018 6:08 pm
Reply with quote

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.
Back to top
View user's profile Send private message
rajiv rengasamy

New User


Joined: 24 Sep 2008
Posts: 26
Location: Chennai

PostPosted: Fri Jul 13, 2018 6:18 pm
Reply with quote

I have put it in coded format in the above message its.Please refer to my earlier reply.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jul 13, 2018 6:26 pm
Reply with quote

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
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Jul 13, 2018 6:55 pm
Reply with quote

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')))         
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Fri Jul 13, 2018 7:33 pm
Reply with quote

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
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Fri Jul 13, 2018 10:16 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sat Jul 14, 2018 12:02 am
Reply with quote

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.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Sat Jul 14, 2018 7:32 pm
Reply with quote

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.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Sat Jul 14, 2018 8:08 pm
Reply with quote

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
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Mon Jul 16, 2018 6:17 pm
Reply with quote

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
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Tue Jul 17, 2018 12:38 am
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts DEBUG COMMENT command not adding to log IBM Tools 1
No new posts Dynamically adding CLIST Library to e... TSO/ISPF 12
No new posts Compare input date as YYMMDD with the... SYNCSORT 5
No new posts Adding FIND to ISPF Panel display of ... TSO/ISPF 3
No new posts Need help in adding Header to records SYNCSORT 1
Search our Forums:

Back to Top