Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Formatting multiple input files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Arun Raj

Moderator


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

PostPosted: Sat Nov 03, 2007 2:03 pm    Post subject: Formatting multiple input files
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    Post subject:
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: 2285
Location: @my desk

PostPosted: Sat Nov 03, 2007 3:32 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing 2 Files using Current time arunsoods DFSORT/ICETOOL 5 Fri Sep 22, 2017 6:00 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us