IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Formatting multiple input files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Nov 03, 2007 2:03 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Nov 03, 2007 2:32 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Nov 03, 2007 3:32 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Nov 03, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top