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

file balancing using sort - need help!!!


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Jun 29, 2006 9:39 pm
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:

Use [URL] BBCode for External Links
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
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 Developer


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

PostPosted: Sat Jun 30, 2007 8:28 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top