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
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
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:
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
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:
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.
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).
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).
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.
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):