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

How can I use READ NEXT command for VSAM


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Sun Jun 10, 2007 7:49 pm
Reply with quote

Hi friends,

How can i ue READ NEXT command for VSAM file defined as below.

FD UUUAG-TRANS-RUN-SEQ-FILE
01 UUAG-TRANS-RUN-SEQ-REC PIC X(80).

Ans in the working storage section the record layout is defined as

01 WW-UUAG-TRANS-RUN-SEQ-REC.
03 WW-UUAG-RUN-SEQ-NO PIC 9(009).
03 WW-UUAG-PROCESS-DATE PIC X(007).
03 WW-UUAG-PROCESS-TIME PIC X(006).
03 WW-UUAG-HIGH-TRANS-SEQ-NO PIC 9(009).
03 WW-UUAG-FILE-ID PIC X(004).
03 FILLER PIC X(045).


Can i use READ UUUAG-TRANS-RUN-SEQ-FILE NEXT
One small restriction i should use INTO clause when i use VSAM file.But is NEXT can be combined with INTO statement.

Please clarify...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sun Jun 10, 2007 8:37 pm
Reply with quote

What kind of VSAM file is it?
What does your SELECT statement look like?
Back to top
View user's profile Send private message
raz832

New User


Joined: 27 Mar 2007
Posts: 15
Location: Chennai

PostPosted: Mon Jun 11, 2007 9:49 am
Reply with quote

Hi william,

Its an KSDS Vsam file..And my select statement looks like:

SELECT UUUAG-TRANS-RUN-SEQ-FILE ASSIGN TO UUUAG
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS UUAG-RUN-SEQ-NO
FILE STATUS IS WW-UUAG-STATUS-CODE.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 2:12 pm
Reply with quote

raz832 wrote:
Can i use READ UUUAG-TRANS-RUN-SEQ-FILE NEXT
One small restriction i should use INTO clause when i use VSAM file.But is NEXT can be combined with INTO statement.
Since it is a keyed file, READ NEXT can be used. The INTO can always be used and is not a restriction.
Back to top
View user's profile Send private message
munikumar
Currently Banned

New User


Joined: 18 Apr 2007
Posts: 24
Location: India

PostPosted: Mon Jun 11, 2007 2:30 pm
Reply with quote

In case of DYNAMIC access method, you can use START command when you know the exact/generic key value of the record. When you know the generic key value you can use READ NEXT command after START.

Regards
Munikumar G
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Tue Jul 24, 2007 12:03 pm
Reply with quote

Will the file status code change as soon as the file pointer switches to a record which has got a key-value other than the one provided during START or only at the end will it change?
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
Search our Forums:

Back to Top