View previous topic :: View next topic |
Author |
Message |
ANDY Beginner

Joined: 07 Feb 2004 Posts: 127 Topics: 67
|
Posted: Thu Feb 24, 2005 2:40 am Post subject: How to append a record in an existing file ? |
|
|
I use the following code to append record,
filename = 'data3'
"ALLOC F(DATAOUT) DA('CuserID.TEST.rexx("filename")') mod reuse"
"NEWSTACK"
new_str. = ''
new_str.1 = 'aaa1'
"EXECIO 1 DISKW DATAOUT (stem new_str. "
but not working.
Can someone tell me why or show me a way?
Thank you _________________ cheers,
Andy |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Feb 24, 2005 3:41 am Post subject: |
|
|
add
new_str.0=1 |
|
Back to top |
|
 |
ANDY Beginner

Joined: 07 Feb 2004 Posts: 127 Topics: 67
|
Posted: Thu Feb 24, 2005 9:43 pm Post subject: |
|
|
Thanks for reply. But I do not think that is the point. _________________ cheers,
Andy |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Feb 24, 2005 10:13 pm Post subject: |
|
|
Did you try it? |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Thu Feb 24, 2005 10:40 pm Post subject: |
|
|
You can't do what you are attempting. From the "z/OS TSO/E REXX Reference" manual on the EXECIO command:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A350/10.3?DT=20040623084642
Quote: |
Notes:
3. Do not use the MOD attribute when allocating a member of a PDS to which you want to append information. You can use MOD only when appending information to a sequential data set. To append information to a member of a PDS, rewrite the member with the additional records added.
|
|
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Thu Feb 24, 2005 10:44 pm Post subject: |
|
|
Can't say I've ever seen anyone attempt to MOD to a member of a PDS. Seems like a rather dangerous undertaking. |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Feb 25, 2005 12:04 am Post subject: |
|
|
I missed that. The EXECIO would not have worked anyway because it was called incorrectly, but it is true. You can't use a PDS DISP=MOD. Unfortunately, ANDY only said it doesn't work and never gave an error message or any indication of what wasn't working, so I just pointed out the first obvious thing I saw & missed the other obvious thing. So Andy, you were right... my suggestion wasn't the only cause of the problem. |
|
Back to top |
|
 |
ANDY Beginner

Joined: 07 Feb 2004 Posts: 127 Topics: 67
|
Posted: Sun Feb 27, 2005 10:47 pm Post subject: |
|
|
Thank you guys. The problem look like EXECIO can only append records to sequential data set. Can not do for a member of PDS.
Superk, Why do you think it is a dangerous undertaking? We can create and update a member of PDS. Why only append is dangerous? Could you give me some ideas?
Thank you. _________________ cheers,
Andy |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sun Feb 27, 2005 11:42 pm Post subject: |
|
|
You can't do it because of the way a PDS is stored. A pds is really a sequential file with the 1st part as the directory. The directory entries point into other parts of the file. Members actually sit next to each other on disk so there is no place to append to (the member sections are not chained together). PDSEs are stored differently (as part of VSAM files I think) so that restriction could be lifted in theory, but it is not as far as I know. |
|
Back to top |
|
 |
ANDY Beginner

Joined: 07 Feb 2004 Posts: 127 Topics: 67
|
Posted: Wed Mar 02, 2005 12:03 am Post subject: |
|
|
Semiqeezer,
Thank you. It make me clear. _________________ cheers,
Andy |
|
Back to top |
|
 |
|
|