Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2445
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: 2445
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: 8620
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: 8201
Location: Dubuque, Iowa, 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: 8201
Location: Dubuque, Iowa, 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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us