Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare yesterday's date to the one o... migusd SYNCSORT 7 Fri Sep 22, 2017 11:35 pm
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 4 Fri Sep 22, 2017 4:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us