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

LRECL in syncsort


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: Tue Feb 19, 2019 6:50 am
Reply with quote

How does having LRECL for output file in syncsort create a difference ? I am seeing different results for below parameters. My shop is using SYNCSORT 2.1.6

Code:

//SORTOUT DD DSN=xyz,
//DISP=(,CATLG),UNIT=SYSALLDA,SPACE=(TRK,(10,5),),RLSE),
//DCB=(SYS2.GDG,RECFM=FB,LRECL=100,BLKSIZE=0,DSORG=PS)


Code:

//SORTOUT DD DSN=xyz,
//DISP=(,CATLG),UNIT=SYSALLDA,SPACE=(TRK,(10,5),),RLSE),
//DCB=(SYS2.GDG,RECFM=FB,BLKSIZE=0,DSORG=PS)

Code:
SYSIN

SORT FIELDS=(1,20,CH,A)
SUM FIELDS=NONE
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Feb 19, 2019 8:00 am
Reply with quote

The "JCL" you posted makes no sense. For example - SPACE=(TRK,(10,5),),RLSE) is completely invalid and will never get by JCL syntax check.

I'm not sure what will happen with DCB=SYS2.GDG,RECFM=FB,BLKSIZE=0,DSORG=PS). I think you will get LRECL = whatever the LRECL in SYS2.GDG

Just to check, I prepared and ran this JCL -
Code:
//A       EXEC PGM=IEFBR14                                   
//PATTERN  DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=&SYSUID..LISTDCB.PATTERN                   
//B       EXEC PGM=IEFBR14                                   
//PATTERN  DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,0),       
//             DCB=(RECFM=VBA,LRECL=125,DSORG=PS),           
//             DSN=*.A.PATTERN                               
//C       EXEC PGM=LISTDCB                                   
//STEPLIB  DD  DISP=SHR,DSN=&SYSUID..LISTDCB.LOAD             
//SYSPRINT DD  SYSOUT=*                                       
//DS01     DD  UNIT=SYSDA,SPACE=(TRK,(1,1)),                 
//             DCB=(RECFM=F,LRECL=80,BLKSIZE=80)             
//DS02     DD  UNIT=SYSDA,SPACE=(TRK,(1,1)),                 
//             DCB=&SYSUID..LISTDCB.PATTERN                   
//DS03     DD  UNIT=SYSDA,SPACE=(TRK,(1,1)),                 
//             DCB=(&SYSUID..LISTDCB.PATTERN,RECFM=F,LRECL=80)

The LISTDCB program just opens and lists the DCB attributes of data sets specified by DD statements that start with DS. I was afraid OPEN would ABEND opening DS03, but it it didn't. It produced this output.
Code:
DDNAME   RECFM LRECL BLKSIZE
DS01     F        80      80
DS02     VBA     125   27998
DS03     F        80   27998
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Tue Feb 19, 2019 6:15 pm
Reply with quote

By running a small sort with
Code:
//SORTIN   DD   *           
//SORTOUT  DD   SYSOUT=*   
I got the following SYSOUT messages:
Code:
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80 
WER073I  SORTIN   : DSNAME=HLQ.JOBNAME.J0083916.D0000101.?   
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    80; BLKSIZE=    80 
WER074I  SORTOUT  : DSNAME=HLQ.JOBNAME.J0083916.D0000104.?   


By using
Code:
//SORTIN   DD   *                       
//SORTOUT  DD   SYSOUT=*,DCB=(LRECL=40)
I received the SYSOUT messages:
Code:
WER108I  SORTIN   : RECFM=FB   ; LRECL=    80; BLKSIZE=    80
WER073I  SORTIN   : DSNAME=HLQ.JOBNAME.J0084001.D0000101.?   
WER110I  SORTOUT  : RECFM=FB   ; LRECL=    40; BLKSIZE=    40
WER074I  SORTOUT  : DSNAME=HLQ.JOBNAME.J0084001.D0000104.?   
WER462I  OUTPUT LRECL DIFFERS FROM SORTOUT LRECL             

Message WER462I explains:
Quote:
Fixed-length records will be padded to the SORTOUT LRECL (SYSUT2 LRECL in a
SYNCGENR application) when the SORTOUT LRECL is greater than the SORTIN or
internally processed record length. Records will be truncated to the SORTOUT
LRECL (SYSUT2 LRECL in a SYNCGENR application) when the SORTOUT LRECL is less
than the SORTIN or internally processed record length.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Wed Feb 20, 2019 2:04 am
Reply with quote

frozenblood87 wrote:
I am seeing different results for below parameters.


What exactly is the difference in results?? icon_rolleyes.gif

When seeing this message it is obvious that you need to reformat your record in accordance with the final DCB parameters taken from anywhere (doesn't matter where from).
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Thu Feb 21, 2019 1:42 am
Reply with quote

AFAIK, the GDG node referred by name in DCB= parameter does not include attributes like LRECL. That's why without explicit LRECL= the record length remains undefined, and SORT utility substitutes it from the calculated output record size.

Those DCB attributes are defined for every instance (or every generation) of GDG referred via (+N) parameter appended to GDG name. But I doubt if this format is accepted inside
DCB=(SYS2.GDG(+0))
and I'm lazy to verify this.
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 Compare only first records of the fil... SYNCSORT 7
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
Search our Forums:

Back to Top