Help with join fields from two files record-by-record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Help with join fields from two files record-by-record

Postby fazillatheef » Mon Feb 25, 2008 1:01 pm

I am new to mainframes and i want to find a method using utilties to copy one record from one sequential file and another record from a second sequenntial file to a new sequential file.

Eg,
sequntial file A contains fields

Sno: ,Name

sequential file B contains fields as follows

Balance , credit

then the utility should produce a sequential file using one field from file A and one field from File B
producing a new sequential file C containing fields like

Sno , Credit



Please help
Last edited by William Thompson on Tue Feb 26, 2008 7:03 pm, edited 1 time in total.
Reason: Change title
fazillatheef
 
Posts: 18
Joined: Mon Feb 25, 2008 12:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help with join fields from two files record-by-record

 

Re: Help in IBM Utilities

Postby arunprasad.k » Mon Feb 25, 2008 1:54 pm

I do not understand your requirement. Answer the following.

#1 How can you match File A and File B without a common field?
#2 Do the common fields has duplicates in any files? If yes tell me which file or files.
#3 Post some sample inputs and intended outputs.
#4 Also the file definitions if possible

Arun.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help in IBM Utilities

Postby fazillatheef » Mon Feb 25, 2008 2:53 pm

An example can be

file A contains

id          name
001         Fazil
002         San
003         Sanjay


file B contains

credit      debit
10            100
32             70
340           239


the utility should make a file c

id          debit
001           100
002            70
340           239
fazillatheef
 
Posts: 18
Joined: Mon Feb 25, 2008 12:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help in IBM Utilities

Postby fazillatheef » Mon Feb 25, 2008 2:58 pm

i dont need any kind of checking or anything like that(that is the first record in the first file is cooresponding to the first record in the second file) ...I just need to make a file that contains the first field in the first file and second field in the second file .
you can assume any length for the fields
fazillatheef
 
Posts: 18
Joined: Mon Feb 25, 2008 12:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help in IBM Utilities

Postby Frank Yaeger » Mon Feb 25, 2008 9:32 pm

You can use a DFSORT/ICETOOL job like the following to do what you asked for.

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD *
001         Fazil
002         San
003         Sanjay
/*
//IN2 DD *
10            100
32             70
340           239
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(81,8,ZD) WITH(13,5) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,10,81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  INREC BUILD=(13:13,5,81:SEQNUM,8,ZD)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,BUILD=(1,80)
/*


For more details, see the "Join fields from two files record-by-record" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/supp ... vs/tricks/
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Help in IBM Utilities

Postby fazillatheef » Tue Feb 26, 2008 9:30 am

Can I do the same using Syncsort?
I dont have DFsort installed on my mainframe.
fazillatheef
 
Posts: 18
Joined: Mon Feb 25, 2008 12:50 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Help with join fields from two files record-by-record

Postby Alissa Margulies » Tue Feb 26, 2008 11:31 pm

fazillatheef wrote:Can I do the same using Syncsort?

YES. With SyncSort, you can either execute PGM=ICETOOL or PGM=SYNCTOOL.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Help with join fields from two files record-by-record

Postby CICS Guy » Wed Feb 27, 2008 4:19 am

Alissa Margulies wrote:With SyncSort, you can either execute PGM=ICETOOL or PGM=SYNCTOOL.
Alissa, welcome to this forum and thank you for your response.....grin.....
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Help with join fields from two files record-by-record

Postby fazillatheef » Wed Feb 27, 2008 12:00 pm

thank you
fazillatheef
 
Posts: 18
Joined: Mon Feb 25, 2008 12:50 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post