hi, i would like to know how can i insert, delete or edit a new record in a dataset using REXX.
first, the user will see the content of all the records in the table. Then the user will be able to insert, delete or update the records in the table. And also is there a way , the REXX program remember which line or record did the user insert, delete or update.
thanks.
Edit a new record in a dataset using REXX
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: Edit a new record in a dataset using REXX
mbisa wrote:i would like to know how can i insert, delete or edit a new record in a dataset using REXX.
For the first two, you use the normal sequential dataset processing guidelines. To insert a record, you'll have to:
a. read the input dataset one record at a time. Write each record to a different output dataset. Write the inserted record where appropriate. Then, continue to read and write until you reach EOF. Then, copy the entire contents of the new output dataset to the old input dataset.
b. allocate the dataset for DISP=MOD processing. You can then insert new records at the end of the dataset.
To delete a record, do the same as "a." above, except you must skip writing the deleted record to the output dataset.
To update an existing record in-place, you can use the DISKRU (Read with Update) and DISKW functions of EXECIO.
mbisa wrote:is there a way , the REXX program remember which line or record did the user insert, delete or update.
Only if you provide some sort of tracking mechanism in your code.
Re: Edit a new record in a dataset using REXX
thanks a lot mr.spock.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 2
- 1269
-
by yarnseeker
View the latest post
Thu May 13, 2021 9:50 pm
-
-
REXX to Edit 3rd Line of all members in PDS
by shiitiizz » Thu Aug 13, 2020 5:21 pm » in CLIST & REXX - 3
- 3723
-
by Pedro
View the latest post
Fri Aug 14, 2020 3:50 am
-
-
- 23
- 4380
-
by collinsm
View the latest post
Thu Sep 22, 2022 5:29 am
-
- 0
- 2714
-
by knv09
View the latest post
Thu Nov 16, 2023 8:16 pm
-
-
Copy partial record after a string in a record using SORT.
by Esmayeelhusen » Thu May 04, 2023 3:03 pm » in DFSORT/ICETOOL/ICEGENER - 16
- 4225
-
by Esmayeelhusen
View the latest post
Mon May 22, 2023 3:50 pm
-