Niki
Active User
Joined: 20 Sep 2008 Posts: 106 Location: Bangalore
|
|
|
|
Hi all,
I am having an input file of Lrecl 7000.
I need to copy the content of the files to another of lrecl = 1000.
SO while copying the record i need to split a single record of the source file into multiple records in the destination file of lrecl = 1000 depending upon wether the string "<CELL>" is present or not ??
For example
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+-
language developed <CELL> for commercial <CELL> application
asdasd <CELL> 12521376
dasd123456789
idruiswrn834284<CELL> sadasdadhfsw<CELL> |
So my output should look like below,
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+-
language developed
for commercial
application
asdasd
12521376
dasd123456789
idruiswrn834284
sadasdadhfsw
|
Could you guys please help me to achieve this through a sort card. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT/ICETOOL job like the following. I assumed that you could have a maximum of 7 strings delimited by <CELL> in one line, but you can handle more by increasing the number of %nn fields appropriately. I also assumed that you wouldn't have any strings delimited by <CELL> that start with more than 50 blanks.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (FB/7000)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=... output file (FB/1000)
//TOOLIN DD *
* Split input records into 1000 byte output records using
* <CELL> as a delimiter.
COPY FROM(IN) USING(CTL1)
* Remove blank lines.
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
OPTION COPY
OUTFIL FNAMES=T1,
PARSE=(%01=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%02=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%03=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%04=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%05=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%06=(ENDBEFR=C'<CELL>',FIXLEN=1000),
%07=(FIXLEN=1000)),
BUILD=(%01,/,%02,/,%03,/,%04,/,%05,/,%06,/,%07)
/*
//CTL2CNTL DD *
OMIT COND=(1,50,CH,EQ,C' ')
/*
|
|
|