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
 

 

vsam file processing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    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

CICS Guy

Senior Member


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

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

Site Director


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

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: 8593
Location: Back in jolly old England

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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM 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 recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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