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 Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts VSAM RLS=NRI while doing IDCAMS sheersh JCL & VSAM 1 Tue Mar 07, 2017 1:55 pm
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm


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