View previous topic :: View next topic
|
Author |
Message |
sudhamani
New User
Joined: 08 Nov 2007 Posts: 19 Location: india
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sudhamani
New User
Joined: 08 Nov 2007 Posts: 19 Location: india
|
|
|
|
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 |
|
|
sudhamani
New User
Joined: 08 Nov 2007 Posts: 19 Location: india
|
|
|
|
Sorry..
The RECFM and LRECL of both the inputs is FB and 80.
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sudhamani
New User
Joined: 08 Nov 2007 Posts: 19 Location: india
|
|
|
|
Thank you Frank for your help. |
|
Back to top |
|
|
|