Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What is the rule by which the EEE record has blanks after Tokyo but the other records don't? I'm going to assume that you really don't want the fields squeezed together like that. If you do, then you're going to have to explain the rules for that. I also assumed the maximum length for a field is 10 characters.
You can use a DFSORT job like the following to do what I think you want.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
AAABangalore
BBBFrankfurt
CCCIslamabad
DDDColombo
EEETokyo
/*
//IN2 DD *
AAAIndia
BBBGermany
CCCPakistan
DDDSrilanka
/*
//IN3 DD *
AAAGold
BBBSilver
CCCBronze
EEEDiamond
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=... output file (FB/40)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(1,3,CH) KEEPNODUPS WITHANY -
WITH(16,10) WITH(27,10)
/*
//CTL1CNTL DD *
INREC OVERLAY=(40:X)
/*
//CTL2CNTL DD *
INREC BUILD=(1,3,16:4,10,40:X)
/*
//CTL3CNTL DD *
INREC BUILD=(1,3,27:4,10,40:X)
/*
|
OUT would have:
Code: |
AAABangalore India Gold
BBBFrankfurt Germany Silver
CCCIslamabad Pakistan Bronze
DDDColombo Srilanka
EEETokyo Diamond
|
|
|