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
 

 

Read VSAM file using partial key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Satheeshkumar

New User


Joined: 20 Feb 2009
Posts: 51
Location: Chennai

PostPosted: Fri May 21, 2010 3:21 pm    Post subject: Read VSAM file using partial key
Reply with quote

Hi,

Please suggest a suitable method to read a VSAM KSDS file using partial key.
The key is of 24 bytes, and I have only data upto first 8 bytes.
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Fri May 21, 2010 3:39 pm    Post subject:
Reply with quote

To name a few :

idcams
sas
easytrev
sort ?
Back to top
View user's profile Send private message
Satheeshkumar

New User


Joined: 20 Feb 2009
Posts: 51
Location: Chennai

PostPosted: Fri May 21, 2010 3:42 pm    Post subject:
Reply with quote

Hi,

Please suggest a suitable method to read a VSAM KSDS file using partial key through cobol batch program.
The key is of 24 bytes, and I have only data upto first 8 bytes.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2433
Location: Netherlands, Amstelveen

PostPosted: Fri May 21, 2010 3:43 pm    Post subject:
Reply with quote

Oh, yes and cobol of course.

I suggest to explore the cobol manual(s), that good enough?
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: Fri May 21, 2010 3:54 pm    Post subject:
Reply with quote

You obviously did not search the forum, otherwise you would have found THIS topic.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 21, 2010 4:44 pm    Post subject:
Reply with quote

There is a manual link at the top of the page. Click on it, find the COBOL Language Environment manual, and read up on the START verb.
Back to top
View user's profile Send private message
Satheeshkumar

New User


Joined: 20 Feb 2009
Posts: 51
Location: Chennai

PostPosted: Fri May 21, 2010 5:46 pm    Post subject:
Reply with quote

I have the code as :
in FILE CONTROL.

SELECT FILE1 ASSIGN TO FILE1
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS RECORD-KEY1
FILE STATUS IS WS-FILE1-STAT.

in working storage

01 RECORD-KEY1
05 CF-TYPE PIC X(01)
05 CF-SK PIC 9(07)
05 CF-SK-NO PIX X(9)
05 CF-P-NUMBER PIC 9(007) COMP-3
05 CF-LI-NUMBER PIC 9(003).


In PROCEDURE DIVISION:
MOVE 'S' TO CF-TYPE .
MOVE 0000018 TO CF-SK.
START FILE1
KEY GREATER THAN OR EQUAL TO RECORD-KEY1
READ FILE1

When i move the full key value to the key files it is working
but I have moved the values to first two fileds then by using the START i am trying to read record from same KSDS file. It throw file status 23. matching record not found.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Fri May 21, 2010 5:50 pm    Post subject:
Reply with quote

1. What did you initialize the other fields of your RECORD-KEY1 to?
2. What was the file status for the START?
3. Why are you not using the VSAM file status extension?
4. Are you using a READ or READ NEXT in your program?

Depending upon your answers to these questions, a file status 23 could be the expected result of your code.
Back to top
View user's profile Send private message
abhishek.sun

New User


Joined: 22 Aug 2008
Posts: 2
Location: Gurgaon

PostPosted: Mon May 24, 2010 10:53 am    Post subject:
Reply with quote

I do agree with Robert.

Move LOW VALUES to rest of the key fields, prior to starting the file:

CF-SK-NO
CF-P-NUMBER
CF-LI-NUMBER

I think that should work.

~Abhi
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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