title: Sorting a variable-length record, blocked, dataset
body: <p>I have tried to sort a VB file.</p>
  
  <p>File data is:<br>
  00000000002 AAA<br>
  00000000001<br>
  00000000003 BBB<br>
  00000000004 CCC<br>
  00000000005       </p>
  
  <p>The JCL I am using for sorting is below:  </p>
  
  <pre><code>//STEP1  EXEC PGM=SORT                                       
  //SYSOUT   DD  SYSOUT=*                                        
  //SYSUDUMP DD  SYSOUT=*                                        
  //SORTWK01 DD  UNIT=SYSTF,SPACE=(01000,(006980,001425),,,ROUND)
  //SYSIN    DD  *                                               
   SORT FIELDS=(17,3,CH,A)                                       
  /*                                                             
  //SORTIN   DD  DSN=TEST.INPUT.FILE1,                            
  //             DISP=SHR                                        
  //SORTOUT  DD  DSN=TEST.OUTPUT.FILE2,                            
  //             DISP=(NEW,CATLG,DELETE),                        
  //             DCB=(RECFM=VB,LRECL=80,BLKSIZE=0),              
  //             UNIT=SYSSF,                                     
  //             SPACE=(CYL,(5,5),RLSE)       
  </code></pre>
  
  <p>This JCL fails with VB file, but works fine with FB file. However, if I add following sort card, it works fine with VB file as well.  </p>
  
  <pre><code> SORT FIELDS=(17,3,CH,A) 
   OPTION VLSHRT           
  </code></pre>
  
  <p>I am trying to find the reason, why this works for FB, but not for VB.</p>