I have a VB file of varying record length. I want to convert it in FB file

304 views Asked by At

I have a VB file of varying record length. I want to convert it in FB file. Input files are having record length of 4000, 4012, 4062 and so on..

I am using below SYSIN SORT card but not getting desired result.

//SYSIN DD *
     OPTION COPY
     OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(5,4000)
/*

How can I copy full input VB file to output FB file using JCL ?

Now what should I provide in OUTREC

1

There are 1 answers

8
Kolusu On

You just need to provide LRECL - 4 as the final length. For example if the input LRECL=5000 and RECFM=VB then when you convert to RECFM=FB, you would provide the LRECL length as 5000 - 4 = 4996.

OPTION COPY 
OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(5,4996)

Since the RECFM=FB every record now will have a length of 4996. Short records are padded with spaces at the end.