Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to merge the files if matching records are found.

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

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Tue May 20, 2008 10:07 pm    Post subject: Need to merge the files if matching records are found.
Reply with quote

Hi All,

My requirement is to merge two files if the userid is present in both the files and with no duplicates.

file1:
user id in col :2-9
file format & positions: userid(2-9) name(12-30) ssn(38-46)


file 2:
user id in col :3-10
format:userid(3-10) name(14-32) racf(36-43)

Required output:
userid(1-8) name(9-30) ssn(27-36) racf(72-80)


can we use ICETOOL for this.

Thanks[/img][/code]
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: Tue May 20, 2008 11:15 pm    Post subject:
Reply with quote

Yes, you can use ICETOOL for that, but you need to clarify some things.

You show name in both input files and in the output file but you don't say which input file the name should come from.

Please show an example of the records in each input file and the expected output records.

Also, what is the RECFM and LRECL of each input file?
Back to top
View user's profile Send private message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Wed May 21, 2008 3:57 pm    Post subject:
Reply with quote

Hi Frank,

the userid ,name and SSN can be taken from FILE1 and Racf from FILE2

FILE1:
userid(2-9) name (12-30) ssn(38-46)

PCSPROB NETWORK MGMT 00000000
PCSPROD NETWORK MGMT 11111111

file:2
userid(3-10) name (14-32) Racf(36-43)

PCSPROB NETWORK MGMT $STCGRP
PCSPROD NETWORK MGMT SYSIDS

required output:

userid(1-8) name (9-26) SSS(27-35) Racf(72-79)

PCSPROB NETWORK MGMT 000000000 $STCGRP
PCSPROD NETWORK MGMT 111111111 SYSIDS

The output file should get the records if the userid is existing in both the file1 and file2 with out duplicates.

THANK U.
Back to top
View user's profile Send private message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Wed May 21, 2008 4:03 pm    Post subject:
Reply with quote

Sorry..

The RECFM and LRECL of both the inputs is FB and 80.


Thanks.
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 May 21, 2008 9:11 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for based on the example you gave (I suspect there may be some other cases that you're not showing involving no matches between file1 and file2 and/or duplicates within each file ... if so you need to show a new example of input and output including those cases).

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
 PCSPROB   NETWORK MGMT              00000000
 PCSPROD   NETWORK MGMT              11111111
/*
//IN2 DD *
  PCSPROB    NETWORK MGMT          $STCGRP
  PCSPROD    NETWORK MGMT          SYSIDS
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) WITH(72,8)
/*
//CTL1CNTL DD *
  INREC BUILD=(1:2,8,9:12,18,27:38,9,80:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1:3,8,72:36,8,80:X)
/*
Back to top
View user's profile Send private message
sudhamani

New User


Joined: 08 Nov 2007
Posts: 19
Location: india

PostPosted: Wed May 21, 2008 9:23 pm    Post subject:
Reply with quote

Thank you Frank for your help.
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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us