|
 |
|
|
| |
|
COBOL Language [
return
] |
|
From |
Message |
TonyT
5/15/2005 20:52:11
|
Subject: File Access
Message: How do I reset the record pointer in a single COBOL II program, when accessing a VSAM KSDS sequentially? I need to read to EOF and then start over from the beginning without having to open and close the file again.
|
ramdantu
5/15/2005 22:34:40
| RE: File Access
Message: Hi,
You can initialize key and start the file from key is not < KSDS-KEY.
Syntax: Start File-Name Key Is not < KSDS-KEY.
After that read that file sequentially. If the file status = 10 then again initialize the key and start that file. Then you need not to close that file again and again.
But you should take caution for when it will end that file. Other wise it will go into loop.
I am herewith giving sample code.
==================================================
100-start.
initialize ksds-key.
start ksds-file key is not < ksds-key.
200-read.
read ksds-file next at end go 300-control.
go 200-read.
300-control.
display 'Do You Want To Start Again (Y/N):'.
accept dummy.
if dymmy = 'Y'
go 100-start
else
go 400-end
end-if.
400-end
stop run.
==================================================
Regards
Siva Ram DS
Cell: 09819558006
India
|
|
|
|
|
|
|
|
|
|
|
[ Go to Top of Page ]
|
|
 |
|
COBUG Forums |
Have COBOL language issues? Let the COBUG members help you.
Post Your Issues!
|
 |
|
Knowledge Bases |
Here are references to COBOL knowledge bases, faqs, tips ...
Read More ...
|
 |
|
Job Resources |
On COBUG's portal, there are references to a wealth of
COBOL job resources.
Read More ...
|
 |
|
Start a COBOL User Group! |
Would you like a COBOL user group in your local area?
Here's how ... |
 |
|
Job and Resume Matchmaker! |
Let COBUG match your job requirement to resumes or your resume to job requirements.
Submit your job requirements and resumes so that we can see if there is a match for you!
|
 |
|