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
Help with join fields from two files record-by-record
-
- Posts: 18
- Joined: Mon Feb 25, 2008 12:50 pm
- Skillset: mainframe rexx tso
- Referer: magazine
Help with join fields from two files record-by-record
Last edited by William Thompson on Tue Feb 26, 2008 7:03 pm, edited 1 time in total.
Reason: Change title
Reason: Change title
-
- Posts: 110
- Joined: Thu Dec 27, 2007 5:18 pm
- Skillset: Known little stuffs to answer a few queries!!
- Referer: Google
- Contact:
Re: Help in IBM Utilities
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.
#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.
-
- Posts: 18
- Joined: Mon Feb 25, 2008 12:50 pm
- Skillset: mainframe rexx tso
- Referer: magazine
Re: Help in IBM Utilities
An example can be
file A contains
file B contains
the utility should make a file c
file A contains
Code: Select all
id name
001 Fazil
002 San
003 Sanjay
file B contains
Code: Select all
credit debit
10 100
32 70
340 239
the utility should make a file c
Code: Select all
id debit
001 100
002 70
340 239
-
- Posts: 18
- Joined: Mon Feb 25, 2008 12:50 pm
- Skillset: mainframe rexx tso
- Referer: magazine
Re: Help in IBM Utilities
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
you can assume any length for the fields
- Frank Yaeger
- Global moderator
- Posts: 1079
- Joined: Sat Jun 09, 2007 8:44 pm
- Skillset: DFSORT, ICETOOL, ICEGENER
- Referer: Search
- Contact:
Re: Help in IBM Utilities
You can use a DFSORT/ICETOOL job like the following to do what you asked for.
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/
Code: Select all
//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
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
-
- Posts: 18
- Joined: Mon Feb 25, 2008 12:50 pm
- Skillset: mainframe rexx tso
- Referer: magazine
Re: Help in IBM Utilities
Can I do the same using Syncsort?
I dont have DFsort installed on my mainframe.
I dont have DFsort installed on my mainframe.
-
- Global moderator
- Posts: 369
- Joined: Tue Feb 26, 2008 11:15 pm
- Skillset: Syncsort MFX for z/OS
- Referer: Dick Scherrer
- Location: USA
- Contact:
Re: Help with join fields from two files record-by-record
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
Alissa, welcome to this forum and thank you for your response.....grin.....Alissa Margulies wrote:With SyncSort, you can either execute PGM=ICETOOL or PGM=SYNCTOOL.
-
- Posts: 18
- Joined: Mon Feb 25, 2008 12:50 pm
- Skillset: mainframe rexx tso
- Referer: magazine
-
- Similar Topics
- Replies
- Views
- Last post
-
-
how to extract a portion (e.g. fields 10 - 20) of a record
by ISPFTSOJCL » Fri Feb 26, 2021 5:33 am » in JCL - 2
- 1691
-
by enrico-sorichetti
View the latest post
Fri Feb 26, 2021 2:37 pm
-
-
-
Extract first record from multiple files
by Prasanna G » Wed Jan 13, 2021 2:14 pm » in DFSORT/ICETOOL/ICEGENER - 5
- 1760
-
by Prasanna G
View the latest post
Wed Jan 13, 2021 11:16 pm
-
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4203
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-
-
-
Merge multiple fixed length files of different record length
by corvette1982 » Mon Mar 01, 2021 11:46 pm » in JCL - 8
- 5276
-
by willy jensen
View the latest post
Tue Mar 02, 2021 3:02 am
-
-
- 2
- 1393
-
by PRDVCF
View the latest post
Thu Nov 17, 2022 9:58 pm