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
 

 

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: 7932
Location: Bellevue, IA

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: 7932
Location: Bellevue, IA

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: 1239
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 REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
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 Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts RACF profile access vasanthz All Other Mainframe Topics 11 Fri Sep 23, 2016 5:51 am


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