I have tried just about each and every example in this forum but I come up short.
As always the obvious eludes me. .
I have to copy all the records from a VB file DCB=RECFM=VB,LRECL=23036,BLKSIZE=27998)
to a FB file(LRECL=132).
I need to copy only first 132 positions from input file, for each input record.
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6--
****** ***************************** Top of Data ********************
000001 RUN DATE = 10/13/2016 Ixy VAL
000002
000003 Dept FILE DSN: XYYYY
000004 xONTROL AGENCY AGENCY ALC SCH
000005 NUMBER ID FILETYPE NUMBER NU
000006 d000001 xyz Ixy xyz 00000001
000007 Accumulated Paym
000008 Reported Totals
000009 File Is Ac
000010 0 Invalid 1st occurrence on pa
****** **************************** Bottom of Data
What I need is a FB file of LRECL of 132. Nice report portion.
What I get is one record: lOOKS LIVE THE FIRST 4 BYTES OF THE vb REC
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+
****** ***************************** Top of Data *************
000001 V ß8 iRUN DATE = i10/13/2016 mITS VALIDATION REPORT
****** **************************** Bottom of Data ***********
014.S1 Columns 00061 00132
Scroll ===> CSR
-9----+----0----+----1----+----2----+----3--
* Top of Data ******************************
ACH'߶ ¥DEPT FILE DSN: XYZT.IN.TEST.DLYX3.
Bottom of Data ****************************
OTHER PERTINENT INFO FOR input FILE:
Code:
General Data
Management class . . :
Storage class . . . :
Volume serial . . . :
Device type . . . . :
Data class . . . . . : NULL
Organization . . . : PS
Record format . . . : VB
Record length . . . : 23036
Block size . . . . : 27998
1st extent blocks . : 2
Secondary blocks . : 1
Data set name type :
That will extend all our records (if needed) to 132 bytes of data. The 137th byte of the input (which you don't need) is clobbered to space. Anything from the original end of record up to the 137th position will be padded with blanks.
You can then use the 132 bytes of data, which will contain trailing spaces, not parts of the next records as you've done so far.
Probably the LRECL is a red-herring. You've probably just got print lines without trailing spaces.