MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Combine 3 files into 1 one using DFSORT!

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Sat Jun 10, 2006 6:03 am    Post subject: Combine 3 files into 1 one using DFSORT! Reply with quote

Hi All,

Can you please help me out in meeting this requirement(using DFSORT).

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
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12367
Topics: 75
Location: San Jose

PostPosted: Sat Jun 10, 2006 6:17 am    Post subject: Reply with quote

raveendra_ibm,

See the "Create files with matching and non-matching records" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Sat Jun 10, 2006 6:28 am    Post subject: Reply with quote

Thanks Kolusu for your prompt reply.

It was indeed very helpful.
The example shown in the link allows you to pick up append the whole record as a field, but not a part of it.

Anyways I'll try to work on this.

Thanking you again,

Regards,
Raveendra.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Jun 10, 2006 3:54 pm    Post subject: Reply with quote

Raveendra,

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)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
raveendra_ibm
Beginner


Joined: 02 Apr 2006
Posts: 32
Topics: 10

PostPosted: Sun Jun 11, 2006 6:33 am    Post subject: Reply with quote

Thank you Frank !!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group