Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
vsam file processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM
Author Message
JOJO

New User


Joined: 06 Dec 2007
Posts: 4
Location: Jacksonville

PostPosted: Mon Mar 31, 2008 8:53 pm    Post subject: vsam file processing
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
References
PostPosted: Mon Mar 31, 2008 8:53 pm    Post subject: Re: vsam file processing Reply with quote

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1117
Location: At my desk

PostPosted: Mon Mar 31, 2008 9:27 pm    Post subject:
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

Global Moderator


Joined: 23 Nov 2006
Posts: 7314
Location: 221 B Baker St

PostPosted: Mon Mar 31, 2008 9:31 pm    Post subject:
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    Post subject: Reply to: vsam file processing
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: 2805
Location: Brussels once more ...

PostPosted: Sat Apr 05, 2008 12:33 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SMS & VSAM All times are GMT + 6 Hours
Page 1 of 1