View previous topic :: View next topic
Author
Message
pushpagiri New User Joined: 07 Jul 2005Posts: 51
Hi,
I want to merge 2 fies vertically.But spaces should be omited.
Exampe:
file1:(FB - 80)
aaaa
bbbbbbb
cc
file2:(FB-100)
xxxxxxxxxx
yyyy
zz
Outfile:(FB-180)
aaaaxxxxxxxxxx
bbbbbbbyyyy
cczz
I have tried to mege these files using ICETOOL-SPICE which give me outfile:
Code:
0 81 180
aaaa xxxxxxxxxx
bbbbbbb yyyy
cc zz
Please guide to some solution.(Can i get the needed output if I convet the input files to VB.)
Regards,
Pushpagiri.
Back to top
pushpagiri New User Joined: 07 Jul 2005Posts: 51
Hi,
The format of outfile in above explanation is explained below.
0 81 180
aaaa xxxxxxxxxx
bbbbbbb yyyy
cc zz
this means that.
a - starts at 0. and 'x' starts at 81.So there are some spaces after 'aaaa' upto column 80.I want to omit these spaces.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Sort products do not have any built-in features for squeezing out blanks.
Back to top
pushpagiri New User Joined: 07 Jul 2005Posts: 51
Hi,
I have solved this problem.But code is a bit complex one.
(Here both input are of LRECL = 80.You can change it as per your need)
Code:
//DFSORT EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=INPUT.PUSH.FILE1,DISP=SHR
//IN2 DD DSN=INPUT.PUSH.FILE2,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TMP1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1 DD DSN=INPUT.PUSH.TEMP91,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80),UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE)
//OUT2 DD DSN=INPUT.PUSH.TEMP92,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=80),UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE)
//OUT DD DSN=OUTPUT.PUSH.FINAL99,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,BLKSIZE=0,LRECL=160),UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CPY1)
COPY FROM(T1) TO(OUT1) USING(CPY2)
COPY FROM(IN2) TO(T1) USING(CPY1)
COPY FROM(T1) TO(OUT2) USING(CPY3)
COPY FROM(OUT1) TO(TMP1) USING(CPY4)
COPY FROM(OUT2) TO(TMP1) USING(CPY5)
SPLICE FROM(TMP1) TO(OUT) ON(161,8,PD)-
WITHEACH WITH(81,80) USING(CPY6)
/*
//CPY1CNTL DD *
OUTFIL FNAMES=T1,FTOV,VLTRIM=X'40'
/*
//CPY2CNTL DD *
OUTFIL FNAMES=OUT1,OUTREC=(1:5,80),
VTOF,VLFILL=C'$'
/*
//CPY3CNTL DD *
OUTFIL FNAMES=OUT2,OUTREC=(1:5,80),
VTOF,VLFILL=C'$'
/*
//CPY4CNTL DD *
OUTREC FIELDS=(1:1,80,161:SEQNUM,8,PD)
/*
//CPY5CNTL DD *
OUTREC FIELDS=(81:1,80,161:SEQNUM,8,PD)
/*
//CPY6CNTL DD *
OUTFIL FNAMES=OUT,OUTREC=(1,160)
/*
//*STEP TO RUN REXX CODE FOR REMOVING '$'S AT END OF EACH FILE
//STEPREXX EXEC PGM=IKJEFT01,PARM='REXREM$'
//SYSEXEC DD DISP=SHR,DSN=PUSH.REXXCODE.PDS
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//FILELIST DD *
OUTPUT.PUSH.FINAL99
/*
Also a REXX code REXREM$ is used here.
To understand more about step STEPREXX, see the topic
http://ibmmainframes.com/viewtopic.php?t=7157
if it is hard to understand the code,see below :
Code:
Solution:
Step : DFSORT
f1: aaaa ->out1:aaaa$$$$$$$$$$
f2: bbbbbb ->out2:bbbbbb$$$$$$$$
(out1+out2) ->tmp1:
aaaa$$$$$$$$$$ 00000001
bbbbbb$$$$$$$$00000001
SPICE(tmp1) ->out:aaaa$$$$$$$$$$bbbbbb$$$$$$$$
Step : STEPREXX
Remove$(out) ->out:aaaabbbbbb
If someone can optimise this code,please reply to this post.
Thanks to all who helped me.
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
Quote:
Sort products do not have any built-in features for squeezing out blanks.
DFSORT now has the SQZ built-in function to squeeze out blanks. This new function is available with z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). Here's the simplified DFSORT/ICETOOL job using SQZ for Push's requirement:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/80)
//IN2 DD DSN=... input file2 (FB/100)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/180)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(181,8,ZD) WITH(81,100) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC OVERLAY=(181:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
OUTREC BUILD=(81:1,100,181:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(1,180,SQZ=(SHIFT=LEFT))
/*
For complete information on all of the new DFSORT and ICETOOL functions available with the April, 2006 DFSORT PTFs, see:
Use [URL] BBCode for External Links
Back to top
pushpagiri New User Joined: 07 Jul 2005Posts: 51
Thankz for the info Frank
Regards,
Push.
Back to top
Please enable JavaScript!