COBOL User Groups COBOL COBOL Programming
Home | Search | User Registration | Membership | Contact | About
COBOL Jobs | Submit Resumes | Post Jobs | Advertise with us

COBOL Resources

 >  Blogs
 >  Books
 >  Code Samples
 >  Courses
 >  Forums
 >  Knowledge Bases
 >  Magazines
 >  Manuals
 >  Portals
 >  Support
 >  Tutorials
 >  User Groups
 >  White Papers

COBOL Software

 >  Change Management
 >  Code Conversion
 >  Compilers
 >  Data Access
 >  Database
 >  Documentation
 >  Editors
 >  File Conversion
 >  GUI
 >  Modernization
 >  Report Generators
 >  Sort
 >  Terminal Emulators
 >  Test
 >  Tools
 >  Trans. Processing

COBOL Information

 >  Events
 >  Job Resources
 >  News Articles
 >  Product News
 >  Standards

Support COBUG

COBOL Donation
 

COBOL Forums

 
COBOL Language [ return ]
From Message
Simon

 Email

1/30/2006
13:34:15
Subject: need help - urgent ;-)


Message:
Hi folks:

I need some help. I have to solve the following problems:

1) Read a record by the Key (Client Number) and update the Address field to "Cologne".

2) A small program to read the dataset serially, and delete all the records. The dataset is called "Kunden" and contains these fields:
- Client-Number : Numeric 6 (Key)
- Name X30
- Address X30
- Tel: Numeric 10.

The file belongs to an Image database on the hp3000 called "Bestellungen".

Any help will be very much appreciated. Thanks a lot in advance!!!

Thanks,
Simon


nathviswa

1/30/2006
20:26:16
RE: need help - urgent ;-)


Message:
1) Lets assume its an ORGANIZATION IS INDEXED file, otherwise it will be little difficult to do this update.
The PROCEDURE DIVISION goes as follows:

MOVE client_no_to_del TO client-no IN file-rec
READ file-name INVALID KEY
DISPLAY 'Client no. doesnt exist'
NOT INVALID KEY
MOVE 'Cologne' TO addr-field IN file-rec
REWRITE file-rec
END-READ.


2) Again lets assume its an ORGANIZATION IS INDEXED file. Otherwise DELETE is problematic.

READ-PARA.
READ file-name NEXT RECORD AT END
DISPLAY 'Delete over'
GO TO NEXT-PARA.
DELETE file-name.
GO TO READ-PARA.
NEXT-PARA.
...........





CodeTalker

5/04/2007
11:14:31
RE: need help - urgent ;-)


Message:
Well, this is terribly old, but in case someone should stumble along, still using an HP3000 and Image database...

Assumptions:
1) You are only serially reading the dataset and are in fact not getting records by key values.

Therefore,

Call "dbget" using database-name
dataset-name
read-mode-2
db-status
db-list-all-items
record-buffer
dummy-value.
move "Cologne" to address-field.
Call "dbupdate" using database-name
dataset-name
update-mode-1
db-status
record-buffer.

Of course you'll want to check the status of each call for a zero value.

And yes, lock your record first and then unlock afterwards.

You cannot read image datasets and check for invalid keys as they are not KSAM files. You cannot open I-O and do a read then rewrite either as they are not flat files.

Again, not likely anyone is still doing much of this anymore and you likely no longer care, but hey, someone might come along and wonder.


 
[ Go to Top of Page ]
COBOL NuTrak Ad


COBOL Forums
COBOL Forum Do you need COBOL help?
Let the COBUG members help you. Post your issues!



COBOL Job Resources
COBOL Jobs Here are references to a wealth of COBOL job resources, including job listing sites, resume preparation, and interview questions.


Job and Resume Matchmaker!
COBOL Jobs Employers submit your COBOL job openings. Job seekers submit your resumes.

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


Start a COBOL User Group!
COBOL User Groups Make a difference today and start an Acucorp User Group, Fujitsu User Group, or Micro Focus User Group

COBOL (c) Information Computing Services. All Rights Reserved. COBOL