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

Help required in Comparing 3 files and writing 1 output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mahendran3784

New User


Joined: 04 May 2007
Posts: 20
Location: INDIA

PostPosted: Fri Apr 18, 2008 4:00 pm
Reply with quote

Hi all,

My requirement is: I have three files.
File 1 Layout
School Name 20 bytes
Student Name 12 bytes

File 2 Layout
Student Name 12 bytes
Parent Name 15 bytes

Fille 3 Layout
Parent Name 15 bytes
Address 35 bytes

I need to get in my output file as,
School Name
Student
Parent Name
Address

It is something like using JOINS in DB2. But i need to get this done using a JCL?

Help me out...
Thanks in Advance
M.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Fri Apr 18, 2008 8:07 pm
Reply with quote

Mahendran3784 wrote:
I need to get in my output file as,
School Name
Student
Parent Name
Address
Assuming the above is a single record, there are many examples showing how to do two files. Once two have been joined to a temp file join it the the third.....
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Apr 18, 2008 9:29 pm
Reply with quote

Mahendran3784,

The following DFSORT/ICETOOL JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD *                                                     
SCHOOL NAME 01      STUDENT01                                       
SCHOOL NAME 02      STUDENT02                                       
SCHOOL NAME 03      STUDENT03                                       
SCHOOL NAME 04      STUDENT04                                       
//IN2      DD *                                                     
STUDENT01   PARENT01                                                 
STUDENT02   PARENT02                                                 
STUDENT03   PARENT03                                                 
STUDENT04   PARENT04                                                 
//IN3      DD *                                                     
PARENT01       ADDRESS 01                                           
PARENT02       ADDRESS 02                                           
PARENT03       ADDRESS 03                                           
PARENT04       ADDRESS 04                                           
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)       
//T2       DD DSN=&&T2,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)       
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                     
  COPY FROM(IN1) USING(CTL1)                                         
  COPY FROM(IN2) USING(CTL2)                                         
  SPLICE FROM(T1) TO(T2) ON(21,12,CH) WITH(33,15) WITHALL USING(CTL3)
  COPY FROM(IN3) USING(CTL4)                                         
  SPLICE FROM(T2) TO(OUT) ON(33,15,CH) WITH(48,35) WITHALL           
//CTL1CNTL DD *                                                     
  OUTFIL FNAMES=T1,BUILD=(1,32,15X)                                 
//CTL2CNTL DD *                                                     
  OUTFIL FNAMES=T1,BUILD=(21:1,12,33:13,15)                         
//CTL3CNTL DD *                                                     
  OUTFIL FNAMES=T2,BUILD=(1,47,35X)                                 
//CTL4CNTL DD *                                                     
  OUTFIL FNAMES=T2,BUILD=(33:1,15,48:16,35)                         
/*
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top