View previous topic :: View next topic
|
Author |
Message |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi all,
I have 3 input files.I want to attach 3 different messages for these files and after that the output should have the concatenated file.
Is it possible to do this in a single step...
eg.
Input files
Code: |
file1 file2 file3
REC1 REC2 REC3
....... ....... .......
....... ....... .......
|
Output file
Code: |
REC1,MSG1
REC2,MSG2
REC3,MSG3
|
Thanks in Advance,
Arun |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
1. If i consider the i/p file like this,
Code: |
file1 file2 file3
REC1 REC2 REC3
REC4 REC5 REC6
....... ....... .......
....... ....... .......
|
Should the o/p be like this
Code: |
REC1,MSG1
REC2,MSG2
REC3,MSG3
REC4,MSG4
REC5,MSG5
REC6,MSG6
|
2. Is there any possibility that you have i/p like this
Code: |
file1 file2 file3
REC1 REC2 REC3
REC4 REC5
|
meant to say that if REC6 is not present?
If so, how it should be handled? |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi krisprems,
Sorry for misdirecting you.
As per the given input, the output should be like this.
Code: |
REC1,MSG1
REC4,MSG1
REC2,MSG2
REC5,MSG2
REC3,MSG3
REC6,MSG3
|
Just nw I got the output right, using ICETOOL. It satisfies my requirement.
Here is my JCL
Code: |
//STEP01 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//FILE1 DD DSN=filename1,DISP=SHR
//FILE2 DD DSN=filename2,DISP=SHR
//FILE3 DD DSN=filename3,DISP=SHR
//*
//TEMP DD DSN=&&TEMP,DISP=(MOD,PASS),
// SPACE=(TRK,(10,10)),
// DCB=(LRECL=43,RECFM=FB)
//*
//OUT DD DSN=IVMD.EX.TEST.ERR,DISP=(NEW,CATLG),
// SPACE=(TRK,(10,10)),
// DCB=(LRECL=43,RECFM=FB)
//*
//TOOLIN DD *
COPY FROM(FILE1) TO(TEMP) USING(CTL1)
COPY FROM(FILE2) TO(TEMP) USING(CTL2)
COPY FROM(FILE3) TO(TEMP) USING(CTL3)
COPY FROM(TEMP) TO(OUT) USING(CTL4)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg1')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg2')
/*
//CTL3CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg3')
/*
//CTL4CNTL DD *
SORT FIELDS=COPY
/* |
Thank you,
Arun |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
arcvns
Your ICETOOL can be tuned like this, note that the Disposition for the OUT DD is MOD
Code: |
//STEP01 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*
//FILE1 DD DSN=filename1,DISP=SHR
//FILE2 DD DSN=filename2,DISP=SHR
//FILE3 DD DSN=filename3,DISP=SHR
//*
//OUT DD DISP=MOD,DSN=... MOD output file
//TOOLIN DD *
COPY FROM(FILE1) TO(OUT) USING(CTL1)
COPY FROM(FILE2) TO(OUT) USING(CTL2)
COPY FROM(FILE3) TO(OUT) USING(CTL3)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg1')
/*
//CTL2CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg2')
/*
//CTL3CNTL DD *
OUTREC FIELDS=(1:1,25,26:C'msg3')
/*
|
|
|
Back to top |
|
|
|
|