Page 1 of 1

Short record

PostPosted: Wed Jul 13, 2016 3:39 pm
by vivekss97
I have below code which short record error..VLtest=2 option is also not stopping this error.
//SORT0005 EXEC PGM=SORT                                          
//SORTIN   DD DSN=ALS.D.K3211T99.FNFG.AMACC.SORTJOIN,DISP=SHR      
//SORTOUT  DD DSN=ALS.D.K3211T99.FNFG.AMACC.SRTFINAL,              
//            DISP=(NEW,CATLG,DELETE),                            
//            RECFM=VB,LRECL=3786,BLKSIZE=0,SPACE=(CYL,(99,9),RLSE)
//SYSOUT   DD SYSOUT=*                                            
//SYSPRINT DD SYSOUT=*                                            
//SYSUDUMP DD SYSOUT=*                                            
//$ORTPARM DD *                                                    
 VLTESTI=2                                                        
//SYSIN    DD *                                                    
 OPTION COPY                                                      
 OUTREC FIELDS=(1,4,5,22,SEQNUM,2,PD,RESTART=(5,22),29,3758)      


Error sysout ...
$ORTPARM : VLTESTI=2                                                    
SYSIN :                                                                
 OPTION COPY                                                            
 OUTREC FIELDS=(1,4,5,22,SEQNUM,2,PD,RESTART=(5,22),29,3758)            
WER161B  ALTERNATE PARM USED                                            
WER276B  SYSDIAG= 8216810, 20191250, 20191250, 19011125                
WER164B  7,908K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,      
WER164B     4K BYTES RESERVE REQUESTED, 2,386,728 BYTES USED            
WER146B  32K BYTES OF EMERGENCY SPACE ALLOCATED                        
WER108I  SORTIN   : RECFM=VB   ; LRECL=  3786; BLKSIZE= 27998          
WER073I  SORTIN   : DSNAME=ALS.D.K3211T99.FNFG.AMACC.SORTJOIN          
WER237I  OUTREC RECORD LENGTH =  3786                                  
WER110I  SORTOUT  : RECFM=VB   ; LRECL=  3786; BLKSIZE= 27998          
WER074I  SORTOUT  : DSNAME=ALS.D.K3211T99.FNFG.AMACC.SRTFINAL          
WER410B  5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B     0 BYTES RESERVE REQUESTED, 2,239,272 BYTES USED          
WER244A  OUTREC - SHORT RECORD


code' d for readability

Re: Short record

PostPosted: Wed Jul 13, 2016 4:22 pm
by Aki88
Hello,

Instead of specifying the outer bound, can you try mentioning only the start position of the data; for example (I've added the position identifiers, you can remove them if you wish):


OUTREC FIELDS=(1:1,4,5:5,22,SEQNUM,2,PD,RESTART=(5,22),29:29)
 


For VB datasets, *SORT products usually fetch the entire data until the end-of-record if the shortest start position is specified.

Re: Short record

PostPosted: Wed Jul 13, 2016 4:37 pm
by vivekss97
Thank you so much. It worked! :)

Re: Short record

PostPosted: Wed Jul 13, 2016 9:25 pm
by BillyBoyo
That is how variable-length records should be dealt with.

Bear in mind a couple of things: don't use FIELDS, use BUILD - they are identical, but BUILD always means one thing, FIELDS means many depending on context, so anything to reduce the number of contexts makes things easier to understandl; Aki88 has added a column number - which in this case means that there is a blank-filled "gap" in your records. I hope you found that. Unless it is required that blanks are inserted for unused fields, don't use columns on BUILD.