BridgetBrackenbury
New User
Joined: 12 Feb 2016 Posts: 4 Location: NZ
|
|
|
|
Hi
I have a VB file LRECL 5014 which I need to limit to an LRECL of 256. Most of the records are less than 256 but some aren't. The output file needs to be VB.
I need to find lines that are longer than 256 and split them up into 256 chunks with an intervening line with something like 'SPLIT LINE' on it so I can tell which lines have been split - This file is going to be emailed and then the long lines need to be put back together - hence the **SPLIT** for ease of finding the rows that were chopped up.
I've figure out a way to do it - but it is quite clunky and is going to be long as I will need about 20 IFTHEN statements. I have got the basics working (breaking it up into lengths of 100 for testing purposes).
Code: |
//SRTNVAS EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=&URTHLQ..INPUT.TEXT
//SORTOUT DD DISP=(SHR),
// DSN=&URTHLQ..TEST.&DATE..TXT,
// RECFM=VB,SPACE=(TRK,(2,1)),UNIT=SYSDA
//SYSIN DD *
OPTION COPY
OUTFIL IFTHEN=(WHEN=(1,2,BI,GT,300),
BUILD=(1,4,5,100,
/,1,4,C'**SPLIT**',/,1,4,105,
/,1,4,C'**SPLIT**',/,1,4,205,
/,1,4,C'**SPLIT**',/,1,4,305)),
IFTHEN=(WHEN=(1,2,BI,GT,200),
BUILD=(1,4,5,100,
/,1,4,C'**SPLIT**',/,1,4,105,
/,1,4,C'**SPLIT**',/,1,4,205)),
IFTHEN=(WHEN=(1,2,BI,GT,100),
BUILD=(1,4,5,100,/,1,4,C'**SPLIT**',/,1,4,105)),
IFTHEN=(WHEN=(1,2,BI,LT,100),
BUILD=(1,4,5))
/* |
Any ideas how I could do this better?
Thanks |
|