View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Wed Nov 14, 2018 9:50 am Post subject: Problems capturing HDELETE output |
|
|
I have a Rexx script that is supposed to delete all files older than a specific number of days. The last part I'm having problem with is capturing the output from the HDELETE command rather than it being splattered over the screen.
I have tried using the msg('off') and the trapmsg('off') as well as the OUTTRAP command. Here is what I'm seeing in my results
Quote: |
160 *-* x = OUTTRAP('alloc.')
161 *-* del_rc = 0
163 *-* address TSO delete_type "'"file_to_delete"'"
>>> "HDELETE 'migrated.filename"
ARC1001I migrated.filename DELETE FAILED, RC=0039, REAS=0008 <------ These lines are splattered onto the screen
ARC1139I ERROR PROCESSING RACF PROTECTED DATA SET, RECOVERY/RECALL/DELETE
ARC1139I (CONT.) TERMINATED
165 *-* select
say alloc.0
1
say alloc.1
DELETE REQUEST 00018053 SENT TO DFSMSHSM
say rc
0
|
Now, the file I'm trying to delete is one I'm not allowed to delete (so that's fine). If I run the SAME code against a non-migrated file (that I'm not allowed to delete either), I can capture the "error" using the following code
Code: |
racf = 'SECURITY VERIFICATION FAILED'
x = OUTTRAP('alloc.')
del_rc = 0
address TSO delete_type "'"file_to_delete"'"
select
when rc = 0 then
say "'"file"' deleted, date "creation_date
when pos(racf,alloc.1) <> 0 then
say "Couldn't delete "file" - no RACF authority"
|
What do I need to do to capture the HDELETE output (the ARC1001I message etc) that I'm missing ? _________________ Michael |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Wed Nov 14, 2018 10:00 am Post subject: |
|
|
Why do you have a script rather than let the MGMTCLAS do what is required ???
That way there shouldn't be any RACF failings if you have DFhsm set up correctly.
If I recall correctly, DFhsm only writes to the log, it does not return a collectable output, so you will need to go to SDSF in your REXX and then go through the DFhsm log that is current.
Of course you will need to determine that any responses that you do collect are the latest ones, as in the ones that you want.
Good luck - I did have some code once but unfortunately mislaid it
Of course, if the problem is merely the messages being issued, isn't there a parameter in the HDELETE that stops them being issued.
After a quick shufty - I don't think that there is _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Wed Nov 14, 2018 10:31 am Post subject: |
|
|
Quick reply to my question since I seem to have found/experimented the answer.
Code: |
rc_39 = 'DELETE FAILED, RC=0039'
if zdlmigr = 'NO' then
do;del_cmd = 'DELETE'; wait = ''; end
else
do;del_cmd = 'HDELETE'; wait = 'WAIT'; end
|
followed by (where delete_type is either DELETE or HDELETE)
Code: |
address TSO delete_type "'"file_to_delete"'" wait
select
when delete_type = 'HDELETE' then
do
select
when rc = 12 & pos(rc_39,alloc.1) <> 0 then
say "Couldn't delete "file" - no RACF authority"
otherwise
/* Default result ??? */
"'"file"' deleted, date "creation_date
end
end
|
seemed to do the trick _________________ Michael |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Nov 15, 2018 2:01 am Post subject: |
|
|
Well done, but, I do ask again, why do you not let the SMS management class deal with these expiries ? _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Thu Nov 15, 2018 4:05 am Post subject: |
|
|
Your question is valid. We've been having a discussion today related to GDPR, and I think the solution above will disappear if we use standardized DSN names that are deleted after 10 days.
(Still, it's a problem that enjoyed solving, and I won't be surprised if I can use the solution some time in the future) _________________ Michael |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Nov 15, 2018 6:01 am Post subject: |
|
|
Not sure if my CSIUTIL is on this forum, but I used that a lot in the past, quite a handy thing for storage admins.
If I remember rightly, an IDCAMS DELETE should also do the delete even if the dataset is migrated. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
|
|