IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to continuously write the output to PDS without overwrit


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jackzhang75

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Tue Jul 22, 2014 1:54 am
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 22, 2014 2:08 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Tue Jul 22, 2014 6:17 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Jul 22, 2014 7:37 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 22, 2014 12:02 pm
Reply with quote

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
View user's profile Send private message
jackzhang75

Active User


Joined: 09 Jun 2014
Posts: 125
Location: US

PostPosted: Tue Jul 22, 2014 6:12 pm
Reply with quote

Thanks all for your answer.

I have SHR to MOD and output to sequential data set , it works. icon_biggrin.gif

Thanks
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
Search our Forums:

Back to Top