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

Merging fields from diferent datasets !


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raveendra_ibm
Currently Banned

New User


Joined: 07 Jan 2006
Posts: 31

PostPosted: Sat Jun 10, 2006 4:29 pm
Reply with quote

Hi All,

Can you please help me out in meeting this requirement.

I have 3 files.

FILE A

Code:
QWERTY 345 YTREWQ
ASDFGH 654 HGFDSA


FILE B

Code:
123456789 678 8766565
123423634 567 8896785


FILE C

Code:
$$&%&*^*() 089 ^&*^*%*%
*&*(&(*&)) 889 #^%#%^%$



Now my requirement is to get a file that has records as follows:

Code:
345    678    089
645    567    889


All the i/p files are VBA and max record length 240.

There are no keys. Just got to copy one field from each file to form a single record.


Please help !!!

Regards,
Raveendra.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Sun Jun 11, 2006 12:22 am
Reply with quote

Hi,
This can be achived with the help of the sequence number.Create the sequence number for the each record in the first file and the second file.then select the required data(345,654) from file one and required data (678,567) from the file 2 based on the key value(ie..sequence number).
you will then get a file with the data like below.

345 678
654 567

then use this file as the filrst file and your 3 rd file as the second file and follow the same procedure to create the final file.

Thank you
Krishy
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: Sun Jun 11, 2006 2:18 am
Reply with quote

The DFSORT/ICETOOL job below will do what you asked for.

Since the input files have RECFM=VBA, the data you show actually starts at position 6 (after 4-byte RDW and 1-byte cc), so I've adjusted the starting positions accordingly. I assumed you didn't want the cc in the output file, so it would have RECFM=VB and LRECL=21. You can change the job appropriately if those assumptions aren't correct.

Code:

//S1    EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN1 DD DSN=...  input file1 (VBA/240)
//IN2 DD DSN=...  input file2 (VBA/240)
//IN3 DD DSN=...  input file3 (VBA/240)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD RECFM=VB,DSN=..   output file (VB/21)
// RECFM=VB
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
COPY FROM(IN3) TO(T1) USING(CTL3)
SPLICE FROM(T1) TO(OUT) ON(5,8,ZD) -
  WITHEACH WITH(20,3) WITH(27,3) USING(CTL4)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,13:13,3,29:X)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,20:16,3,29:X)
/*
//CTL3CNTL DD *
  OUTREC FIELDS=(1,4,5:SEQNUM,8,ZD,27:17,3)
/*
//CTL4CNTL DD *
  OUTFIL FNAMES=OUT,OUTREC=(1,4,13)
/*
Back to top
View user's profile Send private message
raveendra_ibm
Currently Banned

New User


Joined: 07 Jan 2006
Posts: 31

PostPosted: Sun Jun 11, 2006 9:37 am
Reply with quote

Thank you Frank,

It works perfect.

Thank you Krishy !!!

Regards,
Raveendra.
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 Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
Search our Forums:

Back to Top