Reading and updating a file



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Reading and updating a file

Postby ram23bal » Thu Jul 10, 2008 3:16 pm

Hi All,


Is there any way to UPDATE a Variable Block file and WRITE in the same file.
If so plz provide me the syntax.


I tried to read the VB file but I gor the error message

*******B053 FILE SHOULD BE VS OR IS - INFILE
ram23bal
 
Posts: 32
Joined: Sat May 24, 2008 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Reading and updating a file

Postby dick scherrer » Fri Jul 11, 2008 12:55 am

Hello,

You can read or write a qsam file, but not update records in it. It does not depend on fixed/variable.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Reading and updating a file

Postby jayind » Sat Jul 12, 2008 4:58 pm

Hi ram23bal,

Suggestion: If you are not aware of the suggestion i am giving below and If you still want to have updated info in the same file...

1. Create a temporary file with the same parameters as the original file
2. read a record from original file
3. modify/update record contents as you wanted
4. Write updated record into temporary file. Continue steps 2 to 4 till the end of original file
5. Delete the existing original file and recreate it with the same parameters. I suggeste to keep a backup before deleting.
6. copy the temporary file contents into the recreated original file

Hope this helps...
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post