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

vsam file processing


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
JOJO

New User


Joined: 06 Dec 2007
Posts: 4
Location: Jacksonville

PostPosted: Mon Mar 31, 2008 8:53 pm
Reply with quote

Hi,i have a requirement for processing a vsam ksds file (file1) with more than 10000 records and compare with a flat file (file2) with around 1000 records, and copy the matched record to another vsam output file o-file.

The file1 key length is 58 but i need to check for match only with part of the key from position 45 (length 8).
i have given my easytrieve code below. the output file has been already created and hence i am updating it.

The job is taking more than an hour to execute, and i have cancelled it twice, fearing that there is some problem. Is there a better way to code or should i let my job to complete? Pls advise. Thanks!

FILE file2 TABLE 30000
ARG 1 8 A
DESC 10 10 A

FILE file1 VS
file1-KEY 1 58 A
file1-LIB 1 15 A
file1-DESC 45 135 A
file1-NM 45 8 A

FILE o-file VS UPDATE

WS-DESC W 135 A

JOB INPUT NULL

WRITE-file-DETAILS. PROC
GET file1

IF EOF file1
STOP
ELSE
SEARCH file2 WITH file1-NM GIVING WS-DESC
IF file2
WRITE o-file ADD FROM file1
END-IF
GET file1
END-IF
END-PROC
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Mar 31, 2008 9:27 pm
Reply with quote

Have you looked into SEARCH statement in Chapter 13: Table and Array Processing?
Or how about Synchronized File Processing in Chapter 12: File Processing?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Mar 31, 2008 9:31 pm
Reply with quote

Hello,

To compare 10000 records against 1000 should take very little time - a couple of minutes max. . .

I'd suggest you simply sort both sets of data on "the key" and use your sort product to match the files.

You could also use a small bit COBOL code to do a 2-file match/merge to get what you want. If you are not familiar with this, there is a "sticky" near the top of the COBOL section of the forum that is a working sample.
Back to top
View user's profile Send private message
JOJO

New User


Joined: 06 Dec 2007
Posts: 4
Location: Jacksonville

PostPosted: Fri Apr 04, 2008 7:43 pm
Reply with quote

I just changed the JOB INPUT and removed references to EOF as below, and the job ran fine in less than 1 minute.

JOB INPUT file1

SEARCH file2 WITH file1-NM GIVING WS-DESC
IF file2
WRITE o-file ADD FROM file1
END-IF
GOTO JOB

Thanks!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat Apr 05, 2008 12:33 pm
Reply with quote

Take a look at the SELECT statement used by ICETOOL, that can do what you want, and is pretty efficient.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top