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: 2287
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: 2287
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

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