| Author |
Message |
surya anem
New User
Joined: 20 Dec 2007 Posts: 20 Location: Hyderabad
|
|
|
|
Hi,
I have a set of records(say 100) in a file which are displayed in panels for the user to view or edit.
if a user edits the 51st record how do i write that particular record into the data file.
with regards,
surya |
|
| Back to top |
|
 |
References
|
Posted: Tue Apr 29, 2008 4:15 pm Post subject: Re: Replace a particular record in file |
 |
|
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 1797 Location: italy
|
|
|
|
read into a stem all the records,
carry on the updates
rewrite the dataset/member from the stem
there is no way to update a single logical record in a PS datsset |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 883 Location: germany
|
|
|
|
| your file. What kind of file is it? |
|
| Back to top |
|
 |
surya anem
New User
Joined: 20 Dec 2007 Posts: 20 Location: Hyderabad
|
|
|
|
| It is a PS file.......(datafile) |
|
| Back to top |
|
 |
surya anem
New User
Joined: 20 Dec 2007 Posts: 20 Location: Hyderabad
|
|
|
|
Hi
if i have some millions of records and if i have updated just one field of one record..do i have to update all the records
thanks
surya |
|
| Back to top |
|
 |
enrico-sorichetti
Global Moderator
Joined: 14 Mar 2007 Posts: 1797 Location: italy
|
|
|
|
yes,
You will not be updating all the records
You will copy from the input dataset to the output dataset..
thats the basic rule of sequential dataset processing |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 2912 Location: Charlotte,NC USA
|
|
|
|
| I have to double-check this, but I could swear that you can open a dataset and read a single record for update with EXECIO DISKRU, then write the single updated record back with the corresponding EXECIO DISKW, without having to process the entire dataset. |
|
| Back to top |
|
 |
superk
Moderator Team Head
Joined: 26 Apr 2004 Posts: 2912 Location: Charlotte,NC USA
|
|
|
|
I double-checked. You can update a single record. For example, if you have 10,000 records, and you want to update record 5000:
| Code: |
/* REXX */
"EXECIO 1 DISKRU ddname 5000"
Pull the_record
the_record = "THIS RECORD HAS BEEN CHANGED"
Push the_record
"EXECIO 1 DISKW ddname (FINIS"
|
|
|
| Back to top |
|
 |
|
|