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
 
Access mode is Dynamic

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

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Jan 28, 2009 6:34 pm    Post subject: Access mode is Dynamic
Reply with quote

Hi friends,

Can anyone help me on correcting the below code.
will not be executed.

The program statement is mentioned below:

READ INP-FILE INTO INP-REC0
AT END MOVE 1 TO W1-IN-FILE-STATUS
END-READ.

The error message is below:

The "NEXT" phrase was not specified on a "READ" statement with
the "AT END" phrase for a file with "ACCESS MODE DYNAMIC". The "AT END" phrase

I tried giving various formats of NEXT statements along with READ. But the error is not resolved.

Can anyone guide me on what is the correct format.

----farnear----
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Wed Jan 28, 2009 6:40 pm    Post subject:
Reply with quote

And what does the COBOL Language Reference manual (link at the top of the page) say? I'm not sure why
Code:
READ <file name> NEXT
is quite so hard to get right, though.
Back to top
View user's profile Send private message
farnear
Currently Banned

New User


Joined: 27 Nov 2008
Posts: 20
Location: India

PostPosted: Wed Jan 28, 2009 6:47 pm    Post subject:
Reply with quote

Sir,

I followed your suggestion.

It is working perfectly

Thanks so much for your help .

I have just forgotten to check the manual.

--farnear--
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jan 28, 2009 6:48 pm    Post subject:
Reply with quote

Glad to hear it's working.

Manual searches for syntax are probably a lot quicker than posting and waiting for replies.
Back to top
View user's profile Send private message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Thu Jan 29, 2009 3:51 pm    Post subject:
Reply with quote

It looks like an Natural code...which is Incorrectly written.Havent seen COBOL code like this before.

Read File-name ..
..
..
End-read
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jan 29, 2009 5:10 pm    Post subject:
Reply with quote

Hi,
Quote:
Havent seen COBOL code like this before.

From the manual
Quote:
>>-READ--file-name-1--+------+--+--------+---------------------->
'-NEXT-' '-RECORD-'

>--+--------------------+--------------------------------------->
'-INTO--identifier-1-'


INTO identifier-1
identifier-1 is the receiving field.
identifier-1 must be a valid receiving field for the selected sending record description entry in accordance with the rules of the MOVE statement.

The record areas associated with file-name-1 and identifier-1 must not be the same storage area.

When there is only one record description associated with file-name-1 or all the records and the data item referenced by identifier-1 describe an elementary alphanumeric item or an alphanumeric group item, the result of the execution of a READ statement with the INTO phrase is equivalent to the application of the following rules in the order specified:

The execution of the same READ statement without the INTO phrase.
The current record is moved from the record area to the area specified by identifier-1 according to the rules for the MOVE statement without the CORRESPONDING phrase. The size of the current record is determined by rules specified for the RECORD clause. If the file description entry contains a RECORD IS VARYING clause, the implied move is a group move. The implied MOVE statement does not occur if the execution of the READ statement was unsuccessful. Any subscripting or reference modification associated with identifier-1 is evaluated after the record has been read and immediately before it is moved to the data item. The record is available in both the record area and the data item referenced by identifier-1.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Jan 30, 2009 11:44 am    Post subject:
Reply with quote

Scope terminators (END-READ) have been around since COBOL II.
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 User access certification In Mainfram... Virendra Shambharkar All Other Mainframe Topics 4 Tue Oct 03, 2017 12:32 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
This topic is locked: you cannot edit posts or make replies. Limit access to certain RACF group cvnlynn CLIST & REXX 5 Wed Aug 23, 2017 2:28 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm

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