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
 

 

file balancing using sort - need help!!!

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kanisha_prabha

New User


Joined: 10 Mar 2006
Posts: 26

PostPosted: Thu Jun 29, 2006 3:14 pm    Post subject: file balancing using sort - need help!!!
Reply with quote

Hi,
I have 2 datasets. Each has a record length of 99 bytes. I need to pick up a record from file 2 if first 10 characters of any record in file 1 match with first 10 characters of the record in file 2. Can I do this using sort? (not ICEMAN/ICETOOL).

example.
File 1
------
AAAAAAAAAA?????????????
BBBBBBBBBBdont pull record from here since it is file 1
CCCCCCCCC?????????????

File 2
------
XXXXXXXXXXthis record should not be pulled
BBBBBBBBBBthis record should be pulled

Output file
------------
BBBBBBBBBBthis record should be pulled

Thanks,
Kanisha
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: Thu Jun 29, 2006 9:39 pm    Post subject:
Reply with quote

Kanisha,

You can use this DFSORT/ICETOOL job to do what you asked for. Note that input file2 is concatenated before input file1 so we can use FIRSTDUP which is generally more efficient than LASTDUP.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=...  input file2
//    DD DSN=...  input file1
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,10,CH) FIRSTDUP
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Sat Jun 30, 2007 6:44 pm    Post subject: Re: file balancing using sort - need help!!!
Reply with quote

Frank,

The ICETOOL method you have suggested for copying the records from two files is working fine for flat files? But it is not working for VSAM files. Its showing VSAM open errorWhat change needs to be done for using the same for vsam file?
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: Sat Jun 30, 2007 8:28 pm    Post subject:
Reply with quote

S.Selvakumar,

The system does not allow VSAM data sets to be concatenated. You'll need to copy each VSAM file to a MOD flat file and then use the flat file for the SELECT operator. Assuming the VSAM files have the same attributes and the records are fixed length, you could use a DFSORT/ICETOOL job something like this:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  VSAM input file1
//IN2 DD DSN=...  VSAM input file2
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file
//TOOLIN DD *
COPY FROM(IN1) TO(T1) VSAMTYPE(F)
COPY FROM(IN2) TO(T1) VSAMTYPE(F)
SELECT FROM(T1) TO(OUT) ON(1,10,CH) FIRSTDUP
/*
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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