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
 
Joining Three Files, Comparing and Output.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Mar 11, 2009 5:59 pm    Post subject: Joining Three Files, Comparing and Output.
Reply with quote

Hi, I have three files:

File1
Code:

E0000001
E0000003


File2
Code:

E0000001 1234567
E0000003 2222222


File3 (First column is in packed decimal format)
Code:

1234567 323232
2222222 432111


I want to join these and want the output as

Output:
Code:

E0000001 1234567 323232
E0000003 2222222 432111


File 1 LRECL = 8
File 2 LRECL = 75
File 3 first column -- packed decimal from pos 1 to 6. LRECL=80
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Mar 11, 2009 9:15 pm    Post subject:
Reply with quote

In your example, all of the records have matches in all three files. Is that really the case or can there be non-matches between the files. Examples:

- E0000002 in file1 but not in file2

- E0000004 in file1 and E0000001 4444444 in file2, but no 4444444 record in file3

If there can be such non-matches, then please show a more complete example of input records in the three files and expected output records.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Thu Mar 12, 2009 12:07 am    Post subject:
Reply with quote

Hi Frank.. i want to join file 1 with file 2 and if there is a value in second column of file 2 i will join that with file 3 (2nd col of file 2 is the key of col1 of file3) and output col of file1 , col2 of file2 and col2 of file3. pls let me know if i am not clear? thanks.

file1:

Code:

E0000001
E0000002
E0000003


File2:
Code:

E0000001 1234567
E0000002 2222222
E0000003


File3:
Code:

1234567 323232
4342222 432111
1321121 324211


Output:
Code:

E0000001 1234567 323232
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Mar 12, 2009 1:00 am    Post subject:
Reply with quote

If I understand what you want correctly, then this DFSORT/ICETOOL job will do it. It wasn't clear where field2 of file3 started, so I assumed it started in position 9. Adjust if appropriate.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/8)
//IN2 DD DSN=...  input file2 (FB/75)
//IN3 DD DSN=...  input file3 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL1)
SELECT FROM(T1) TO(T2) ON(1,8,CH) FIRSTDUP
COPY FROM(IN3) TO(T2) USING(CTL2)
SPLICE FROM(T2) TO(OUT) ON(10,7,ZD) WITH(18,6)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(80:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(10:1,6,PD,TO=ZD,LENGTH=7,18:9,6,80:X)
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

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