Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Merging fields from diferent datasets !

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Merging fields from diferent datasets !
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    Post subject: Re: Merging fields from diferent datasets !
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Jun 11, 2006 2:18 am    Post subject:
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    Post subject: Re: Merging fields from diferent datasets !
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us