Page 1 of 1

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

PostPosted: Mon Feb 25, 2008 1:01 pm
by fazillatheef
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

Re: Help in IBM Utilities

PostPosted: Mon Feb 25, 2008 1:54 pm
by arunprasad.k
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.

Re: Help in IBM Utilities

PostPosted: Mon Feb 25, 2008 2:53 pm
by fazillatheef
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

Re: Help in IBM Utilities

PostPosted: Mon Feb 25, 2008 2:58 pm
by fazillatheef
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

Re: Help in IBM Utilities

PostPosted: Mon Feb 25, 2008 9:32 pm
by Frank Yaeger
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/

Re: Help in IBM Utilities

PostPosted: Tue Feb 26, 2008 9:30 am
by fazillatheef
Can I do the same using Syncsort?
I dont have DFsort installed on my mainframe.

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

PostPosted: Tue Feb 26, 2008 11:31 pm
by Alissa Margulies
fazillatheef wrote:Can I do the same using Syncsort?

YES. With SyncSort, you can either execute PGM=ICETOOL or PGM=SYNCTOOL.

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

PostPosted: Wed Feb 27, 2008 4:19 am
by CICS Guy
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.....

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

PostPosted: Wed Feb 27, 2008 12:00 pm
by fazillatheef
thank you