View previous topic :: View next topic
|
Author |
Message |
jackzhang75
Active User
Joined: 09 Jun 2014 Posts: 125 Location: US
|
|
|
|
Hi ,
I got several rexx to QUEUE the ouput to the same member. The member will be overwirten each time i run the rexx. So i want to keep each record and don't want to overwite. I want to add new record in the same member each time when i run the rexx. How to do that ? Thanks
My code :
Code: |
/* REXX */
JOBNAME=HAO
QUEUE ' THIS IS THE TEST '
"ALLOC DA('TTAT.TSP.TU14.PANEL("||JOBNAME||")') F(MYOUTDD) SHR REUSE"
"EXECIO * DISKW MYOUTDD (FINIS"
"FREE F(MYOUTDD)" |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
What you want to do cannot be done -- period. Write to different sequential data sets, or members of different PDS / PDSE data sets, or accept that your task cannot be accomplished and move on to something that can be done. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I want to add new record in the same member |
Your requirement is not clear. It seems like you want to append new information at the end of the existing member. Please confirm.
Instead of SHR, try using MOD. But I do not think you can do MOD for a PDS member, so likely you will need to use a sequential data set with Disp=MOD. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Pedro and Mr. Sample are both correct.
It is possible to update a PDS member in place, but it requires specially written Assembler. I've never done it, but I think I could do it if I ever have to. As far as I know, the only applications that can update a member in place are IEBUPDTE and AMASPZAP.
As Pedro says, you cannot extend (e.g., add records) an existing PDS member, even if the member is known to be the last physical member in the data set.
When a program opens a partitioned data set for output, you are opening it to add one or members to the end of the data set. In other words, it is being opened as "MOD," regardless of the initial status implied by the DISP JCL parameter. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
read the member in a stem
add new record to the stem
write the stem to the member
This is of course a replace, not an append. |
|
Back to top |
|
|
jackzhang75
Active User
Joined: 09 Jun 2014 Posts: 125 Location: US
|
|
|
|
Thanks all for your answer.
I have SHR to MOD and output to sequential data set , it works.
Thanks |
|
Back to top |
|
|
|