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
 

 

How can I use READ NEXT command for VSAM

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How can I use READ NEXT command for VSAM
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: 3158
Location: Tucson AZ

PostPosted: Sun Jun 10, 2007 8:37 pm    Post subject:
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    Post subject: Re: How can I use READ NEXT command for VSAM
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: 3158
Location: Tucson AZ

PostPosted: Mon Jun 11, 2007 2:12 pm    Post subject: Re: How can I use READ NEXT command for VSAM
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    Post subject: Re: How can I use READ NEXT command for VSAM
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    Post subject: Reg READ... NEXT
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    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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
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 What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am


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