|
View previous topic :: View next topic
|
| Author |
Message |
frozenblood87
New User

Joined: 27 Dec 2016 Posts: 5 Location: USA
|
|
|
|
Hi,
I am getting WER268A OUTREC STATEMENT : SYNTAX ERROR
error in my SORT step, i am not sure what is incorrect, please assist
| Code: |
//SORTSTEP EXEC PGM=SORT
//SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
//SORTIN DD DSN=Input,DISP=SHR
//SORTOUT DD DSN=Output(+1),
// DISP=(,CATLG),
// DCB=(RECFM=FB,LRECL=125,BLKSIZE=0),
// SPACE=(TRK,(15,5),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:C'SYSTEM',21:31,6,41:81,20),
HEADER1=(1:C'UPDATER',21:C'PLUSS ID',41:C'LAST NAME',
61:C'FIRST NAME',82:C'TEMPLATE',102:C'PLUSS ID'),
HEADER2=('')
/* |
CODE' D |
|
| Back to top |
|
 |
dneufarth
Active User

Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
| Suggest you post in correct forum, use CODE tags and include all messages produced by Syncsort. |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
| Change OUTREC to OUTFIL. |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),
|
|
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
Moderator,
Please move this page to syncsort. |
|
| Back to top |
|
 |
frozenblood87
New User

Joined: 27 Dec 2016 Posts: 5 Location: USA
|
|
|
|
| magesh23586 wrote: |
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),
|
|
Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL
Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL |
|
| Back to top |
|
 |
magesh23586
Active User

Joined: 06 Jul 2009 Posts: 213 Location: Chennai
|
|
|
|
| frozenblood87 wrote: |
| magesh23586 wrote: |
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),
|
|
Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL
Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL |
I missed to notice the output LRECL
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,125:X)
|
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| frozenblood87 wrote: |
| magesh23586 wrote: |
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),
|
|
Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL
Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL |
Whenever OUTFIL statement includes any of HEADERx= or TRAILERx= parameters, SYNCSORT by default increases record size by 1, and changes RECFM from FB to FBA, (or from VB to VBA). It assumes that using any HEADER/TRAILER involves mandatory printing of the produced report.
Nowadays it is usually not the case; in order to prevent this, your OUTFIL statement requires extra parameter REMOVECC:
| Code: |
. . . . .
OUTFIL REMOVECC, . . .
. . . . . . .
END |
|
|
| Back to top |
|
 |
frozenblood87
New User

Joined: 27 Dec 2016 Posts: 5 Location: USA
|
|
|
|
Thank you, I included the parameter to remove carriage control however I now get an error for overlapping fields, I have counted the positions and don't see an overlap, any idea what might be causing this error now? My output file is FB with LRECL of 125
| Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,
BUILD=(1:C'SYSTEM',21:131,6,41:81,19,61:51,20,
82:C'SKEL-ALL-SYS-ISSUE',102:131,6,
108:C' ',125:X),
HEADER1=(1:C'UPDATER',21:C'PLUSS ID',41:C'LAST NAME',
61:C'FIRST NAME',82:C'TEMPLATE',102:C'PLUSS ID'),
HEADER2=('') |
Error-
| Code: |
| WER136A SORTOUT OUTREC HAS OVERLAPPING FIELDS SPECIFIED |
| sergeyken wrote: |
| frozenblood87 wrote: |
| magesh23586 wrote: |
Also it appears your OUTREC FIELD length is less than header length so you may need to add 109:X
| Code: |
OUTFIL BUILD=(1:C'SYSTEM',21:31,6,41:81,20,109:X),
|
|
Thanks Magesh, after the changes I get the following errors-
WER107A SORTOUT RECFM INCOMPATIBLE WITH REPORT WRITING
WER247A SORTOUT HAS INCOMPATIBLE LRECL
Upon changing my output file RECFM to FBA I still get this error
WER247A SORTOUT HAS INCOMPATIBLE LRECL |
Whenever OUTFIL statement includes any of HEADERx= or TRAILERx= parameters, SYNCSORT by default increases record size by 1, and changes RECFM from FB to FBA, (or from VB to VBA). It assumes that using any HEADER/TRAILER involves mandatory printing of the produced report.
Nowadays it is usually not the case; in order to prevent this, your OUTFIL statement requires extra parameter REMOVECC:
| Code: |
. . . . .
OUTFIL REMOVECC, . . .
. . . . . . .
END |
|
|
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| frozenblood87 wrote: |
| Thank you, I included the parameter to remove carriage control however I now get an error for overlapping fields, I have counted the positions and don't see an overlap, any idea what might be causing this error now? My output file is FB with LRECL of 125 |
Temporary remove your HEADER parameter, and then carefully analyze the produced output record - the field sizes, and positions, and the whole LRECL produced.
Next, accurately re-calculate all the required size, and position of your HEADER fields, and include the updated HEADER parameter back to OUTFIL statement.
You can also add the HEADER sub-parameters one by one to your OUTFIL statement, until you get the first error message. This will point you to your particular erroneous HEADER element.
There are no such things as miracles.
This job is not rocket science - this is primitive arithmetic in calculation of field positions. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
I always recommend to any topic starter, not to be lazy, and carefully re-format his code presented to public - for code itself to be easier to understand (and to update during debugging).
| Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,
BUILD=(1:C'SYSTEM',
21:131,6,
41:81,19,
61:51,20,
82:C'SKEL-ALL-SYS-ISSUE',
102:131,6,
108:C' ',
125:X),
HEADER1=(1:C'UPDATER',
21:C'PLUSS ID',
41:C'LAST NAME',
61:C'FIRST NAME',
82:C'TEMPLATE',
102:C'PLUSS ID'),
HEADER2=('') |
In this case it's getting easier also to temporary comment-out separate lines while debugging and testing it. |
|
| Back to top |
|
 |
frozenblood87
New User

Joined: 27 Dec 2016 Posts: 5 Location: USA
|
|
|
|
| sergeyken wrote: |
I always recommend to any topic starter, not to be lazy, and carefully re-format his code presented to public - for code itself to be easier to understand (and to update during debugging).
| Code: |
SORT FIELDS=COPY
OUTFIL REMOVECC,
BUILD=(1:C'SYSTEM',
21:131,6,
41:81,19,
61:51,20,
82:C'SKEL-ALL-SYS-ISSUE',
102:131,6,
108:C' ',
125:X),
HEADER1=(1:C'UPDATER',
21:C'PLUSS ID',
41:C'LAST NAME',
61:C'FIRST NAME',
82:C'TEMPLATE',
102:C'PLUSS ID'),
HEADER2=('') |
In this case it's getting easier also to temporary comment-out separate lines while debugging and testing it. |
Thank you, I found the issue. I had three extra spaces in the outrec.
I am getting a blank row inserted after every 59 records i.e., on multiples of 60. Is it that header2 is being written every time..How can I avoid that ? I just want the header2 to be written once. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| frozenblood87 wrote: |
| I am getting a blank row inserted after every 59 records i.e., on multiples of 60. Is it that header2 is being written every time..How can I avoid that ? I just want the header2 to be written once. |
You don't need HEADER2 at all. HEADER2 is specifically introduced to create page headers.
If you want to get empty line(s) after your HEADER1 (i.e. report header), just add "newline" parameter(s):
| Code: |
. . . . .
OUTFIL . . . . ,
HEADER1=(. . . . . . . ,
. . . . . . . . . ,
///) skip 3 lines after the HEADER
. . . . . .
END
|
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|