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

Need to merge the files if matching records are found.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue May 20, 2008 11:15 pm
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
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
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 Developer


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

PostPosted: Wed May 21, 2008 9:11 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
Search our Forums:

Back to Top