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

WER268A OUTREC STATEMENT : SYNTAX ERROR


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
frozenblood87

New User


Joined: 27 Dec 2016
Posts: 5
Location: USA

PostPosted: Sat Aug 26, 2017 9:45 pm
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 418
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Sun Aug 27, 2017 12:37 am
Reply with quote

Suggest you post in correct forum, use CODE tags and include all messages produced by Syncsort.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Sun Aug 27, 2017 11:08 am
Reply with quote

Change OUTREC to OUTFIL.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Sun Aug 27, 2017 11:20 am
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Mon Aug 28, 2017 4:37 am
Reply with quote

Moderator,

Please move this page to syncsort.
Back to top
View user's profile Send private message
frozenblood87

New User


Joined: 27 Dec 2016
Posts: 5
Location: USA

PostPosted: Mon Aug 28, 2017 5:52 am
Reply with quote

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
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Mon Aug 28, 2017 7:09 am
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Aug 28, 2017 7:24 pm
Reply with quote

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
View user's profile Send private message
frozenblood87

New User


Joined: 27 Dec 2016
Posts: 5
Location: USA

PostPosted: Mon Aug 28, 2017 9:08 pm
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Aug 28, 2017 9:34 pm
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Mon Aug 28, 2017 9:52 pm
Reply with quote

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
View user's profile Send private message
frozenblood87

New User


Joined: 27 Dec 2016
Posts: 5
Location: USA

PostPosted: Mon Aug 28, 2017 11:11 pm
Reply with quote

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

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Tue Aug 29, 2017 12:03 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
Search our Forums:

Back to Top