vespa,
It looks like you want to split the records when you encounter CRLF (x'0D0A') . Do you know the max segments you have within each record? I guess you do realize that padding with spaces after the split would make them all 508 byte records thus making the VB file useless? It would better off to have a FB file when all the records are of the same length.
I think the whole problem could be avoided if you FTP data from the PC to mainframe in
binary mode the CRLF will be removed automatically and your data will be split into different records once it encounters CRLF.
sample FTP job
//STEPFTP EXEC PGM=FTP,PARM='/(EXIT',REGION=7000K
//INVB DD DSN=<host file>,RECFM=VB,LRECL=512,BLKSIZE=27998
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
server name
user password
Binary
cd /filepath
get pc file //dd:invb
quit
/*
If you still insist on doing it via sort the following DFSORT JCL will give you the desired results. I assumed that you have a max of 10 segments within each record.
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=Your input vb file,DISP=SHR
//SORTOUT DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL PARSE=(%01=(ENDBEFR=X'0D0A',FIXLEN=508),
%02=(ENDBEFR=X'0D0A',FIXLEN=508),
%03=(ENDBEFR=X'0D0A',FIXLEN=508),
%04=(ENDBEFR=X'0D0A',FIXLEN=508),
%05=(ENDBEFR=X'0D0A',FIXLEN=508),
%06=(ENDBEFR=X'0D0A',FIXLEN=508),
%07=(ENDBEFR=X'0D0A',FIXLEN=508),
%08=(ENDBEFR=X'0D0A',FIXLEN=508),
%09=(ENDBEFR=X'0D0A',FIXLEN=508),
%10=(ENDBEFR=X'0D0A',FIXLEN=508)),
BUILD=(1,4,%01,/,1,4,%02,/,1,4,%03,/,1,4,%04,/,1,4,%05,/,
1,4,%06,/,1,4,%07,/,1,4,%08,/,1,4,%09,/,1,4,%10)
//*
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&T1,DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OMIT COND=(5,256,CH,EQ,C' ',AND,257,252,CH,EQ,C' ')
//*