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

Move 0 to EOF-FLG


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

New User


Joined: 11 Oct 2005
Posts: 3
Location: Philippines

PostPosted: Sat Feb 11, 2006 8:46 am
Reply with quote

im reading a SAM file. after the read, i move 0 to eof-flg2 since i have to re-read it again from the start whenever it conforms with my given condition.

the code goes something like this:

read1.
read sam-file1 into record1
at end move 1 to eof-flg1
go to read1-exit.

if condition 1 then
move field1 to var1
perform read2 thru read2-exit.

move 0 to eof-flg2.

read1-exit. exit.

read2.
read sam-file2 into record2
at end move 1 to eof-flg2.

if field2 = var1 then
move ... to...
end-read.

read2-exit. exit.

but im getting status code 46 = ATTEMPT TO READ THE NEXT NONEXISTENT RECORD

and when i displayed eof-flg2,its equal to 1.
it should be equal to zero.
how can i get to read the sam-file2 again from the start of the file?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Sat Feb 11, 2006 1:51 pm
Reply with quote

Where do you close sam-file2, and then re-open it so that the pointer is moved back to the top?
Back to top
View user's profile Send private message
Aji

New User


Joined: 03 Feb 2006
Posts: 53
Location: Mumbai

PostPosted: Mon Feb 13, 2006 11:05 am
Reply with quote

Hi,
Once you r going for reread, initialize the key field (or move low values to key field), start (using start command) on the key field, read the record.

Records

Aji Cherian
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 COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
No new posts How to move the first field of each r... DFSORT/ICETOOL 5
No new posts How to move DB2 Installation HLQ DB2 4
No new posts How to move values from single dimens... COBOL Programming 1
No new posts Reading the CSV data in COBOL and mov... COBOL Programming 4
Search our Forums:

Back to Top