|
View previous topic :: View next topic
|
| Author |
Message |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10899 Location: italy
|
|
|
|
| wouldn' t it be simpler to READ the manual on how to include comments in the &sort control statements stream ? |
|
| Back to top |
|
 |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10899 Location: italy
|
|
|
|
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 |
|
 |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
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 |
|
 |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
| sorry I meant,but somehow i am still not successful. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1216 Location: Dublin, Ireland
|
|
|
|
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 |
|
 |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
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 |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1216 Location: Dublin, Ireland
|
|
|
|
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 |
|
 |
rajiv rengasamy
New User
Joined: 24 Sep 2008 Posts: 26 Location: Chennai
|
|
|
|
| I have put it in coded format in the above message its.Please refer to my earlier reply. |
|
| Back to top |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
| 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 |
|
 |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2482 Location: @my desk
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
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 |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|