Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
WER268A OUTREC STATEMENT : SYNTAX ERROR

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
frozenblood87

New User


Joined: 27 Dec 2016
Posts: 4
Location: USA

PostPosted: Sat Aug 26, 2017 9:45 pm    Post subject: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 252
Location: Cincinnati OH USA

PostPosted: Sun Aug 27, 2017 12:37 am    Post subject:
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: 202
Location: Chennai

PostPosted: Sun Aug 27, 2017 11:08 am    Post subject: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 202
Location: Chennai

PostPosted: Sun Aug 27, 2017 11:20 am    Post subject: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 202
Location: Chennai

PostPosted: Mon Aug 28, 2017 4:37 am    Post subject: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 4
Location: USA

PostPosted: Mon Aug 28, 2017 5:52 am    Post subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 202
Location: Chennai

PostPosted: Mon Aug 28, 2017 7:09 am    Post subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Mon Aug 28, 2017 7:24 pm    Post subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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: 4
Location: USA

PostPosted: Mon Aug 28, 2017 9:08 pm    Post subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Mon Aug 28, 2017 9:34 pm    Post subject: Re: Reply to: WER268A OUTREC STATEMENT : SYNTAX ERROR
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

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Mon Aug 28, 2017 9:52 pm    Post subject:
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: 4
Location: USA

PostPosted: Mon Aug 28, 2017 11:11 pm    Post subject:
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

Active User


Joined: 29 Apr 2008
Posts: 175
Location: Maryland

PostPosted: Tue Aug 29, 2017 12:03 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 5 Thu Sep 07, 2017 6:02 pm
No new posts Error in SQL-PLIST3 'Above value tru... rikdeb DB2 4 Wed Sep 06, 2017 1:34 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us