COBOL User Groups COBUG Header Graphics COBOL User Groups COBUG Logo COBOL User Groups COBUG Header Graphics
Home | Search | User Registration | Membership | Contact | About | Advertise

COBOL Resources
 >  Academics
 >  Books
 >  Code Samples
 >  Forums
 >  Knowledge Bases
 >  Magazines
 >  Portals
 >  User Groups
 >  Vendor Manuals
 >  Vendor Support
 >  White Papers
COBOL User Groups COBUG Spacer Graphics

COBOL Software
 >  Change Management
 >  Code Conversion
 >  Compilers/IDEs
 >  Data Access
 >  Database Management
 >  Debugging and Testing
 >  Documentation
 >  Editors
 >  File Conversion
 >  Graphical User Interfaces
 >  Middleware/Integration
 >  Report Generators
 >  Sort
 >  Terminal Emulators
 >  Transaction Processing
 >  Utilities
COBOL User Groups COBUG Spacer Graphics

General Information
 >  COBOL Jobs
 >  Upcoming Events
 >  COBOL News
 >  Product News
 >  COBOL Standards
COBOL User Groups COBUG Spacer Graphics
COBOL User Groups COBUG Spacer Graphics
 

COBUG Forums

 
COBOL Language [ return ]
From Message
TonyT

 Email

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 ]
COBOL User Groups COBUG Spacer Graphics
COBUG Forums
COBOL User Groups COBUG COBOL Forums Graphics Have COBOL language issues? Let the COBUG members help you.
Post Your Issues!

COBOL User Groups COBUG Spacer Graphics

Knowledge Bases
COBOL User Groups COBUG COBOL Knowledge Bases Graphics Here are references to COBOL knowledge bases, faqs, tips ...
Read More ...

COBOL User Groups COBUG Spacer Graphics

Job Resources
COBOL User Groups COBUG COBOL Jobs Graphics On COBUG's portal, there are references to a wealth of COBOL job resources.
Read More ...

COBOL User Groups COBUG Spacer Graphics

Join COBUG!
COBOL User Groups COBUG Join COBUG Graphics Become a part of the COBOL community today. Register Now ...

COBOL User Groups COBUG Spacer Graphics

Start a COBOL User Group!
COBOL User Groups COBUG Start User Group Graphics Would you like a COBOL user group in your local area?
Here's how ...
COBOL User Groups COBUG Spacer Graphics

Job and Resume Matchmaker!
COBOL User Groups COBUG COBOL Jobs and Resumes Submission Graphics 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!
COBOL User Groups COBUG Spacer Graphics

COBOL User Groups COBUG Footer Graphics (c) Information Computing Services. All Rights Reserved. COBOL User Groups COBUG Footer Graphics