Interesting issue... I had never seen it and I use this SDSF API a lot...
However, I always EXECIO the SYSOUT when I do this. It seems weird to me to
go through all this then not use the data. So, I wrote a simple example of
this process to play with.
What I found is when you actually EXECIO the SYSOUT and use the FINIS
option, everything nicely deallocates. When you do not EXECIO, the SYSOUTs
all stay allocated. You will see the following lines in my sample below:
/* address TSO "EXECIO * DISKR" isfddname.1 "(STEM OUT. FINIS" */
say jname.j $ddname.d isfddname.1 out.0
"FREE F("isfddname.1")"
/* drop out. */
When the EXECIO was not commented out, the FREE would fail (since the EXECIO
caused the deallocate). When the EXECIO was commented out the FREE worked
fine.
Here is my testing code:
/*********************************************************************/
/* REXX */
/*********************************************************************/
/* Purpose: Review all SYSOUTS for a prefix of jobs */
/*-------------------------------------------------------------------*/
/* Syntax: SDSFSOUT */
/*-------------------------------------------------------------------*/
/* Parms: PATTERN - Valid SDSF PREFIX value (def: current jobname) */
/* LPAR - Valid SDSF SYSNAME value (def: all LPAR's) */
/* */
/*********************************************************************/
/* Change Log */
/* */
/* Author Date Reason */
/* -------- --------- ----------------------------------------- */
/* R. Zenuk Mar 2012 Initial Creation */
/* */
/*********************************************************************/
/* Accept the JOB prefix */
/*********************************************************************/
arg pattern lpar
if pattern = '' then
pattern = mvsvar('SYMDEF','JOBNAME')
if lpar = '' then
lpar = '*'
isfprefix = pattern
isfsysname = lpar
out.0 = 0
/*********************************************************************/
/* Invoke SDSF DA using the prefix */
/*********************************************************************/
if isfcalls('ON') <> 0 then exit 99
call sdsfapi "ISFEXEC DA"
/*********************************************************************/
/* LISTA ST */
/*********************************************************************/
"LISTA ST"
/*********************************************************************/
/* Find the matching jobnames */
/*********************************************************************/
do j=1 to isfrows
/*********************************************************************/
/* Select the jobname and allocate all the output sysout datasets */
/*********************************************************************/
say jname.j jobid.j sysname.j
call sdsfapi "ISFACT DA TOKEN('"token.j"') PARM(NP ?) (PREFIX $"
/*********************************************************************/
/* Read the DD list for each job */
/*********************************************************************/
do d=1 to $ddname.0
call sdsfapi "ISFACT DA TOKEN('"$token.d"') PARM(NP SA)"
/*********************************************************************/
/* Read each SYSOUT */
/*********************************************************************/
/* address TSO "EXECIO * DISKR" isfddname.1 "(STEM OUT. FINIS" */
say jname.j $ddname.d isfddname.1 out.0
"FREE F("isfddname.1")"
/* drop out. */
end
end
say
call isfcalls 'OFF'
/*********************************************************************/
/* LISTA ST */
/*********************************************************************/
"LISTA ST"
exit 0
/*********************************************************************/
/* SDSF error conditions */
/*********************************************************************/
sdsfapi: parse arg sdsfcall
address SDSF sdsfcall
select
/*********************************************************************/
/* Ignorable conditions */
/*********************************************************************/
when isfmsg = '' then return
when isfmsg = 'DATA SET ALLOCATED' then return
/*********************************************************************/
/* Real errors - always RC=16 */
/*********************************************************************/
otherwise
do
say isfmsg
say
do e=1 to isfmsg2.0
say sdsfcall right(e,2)':' isfmsg2.e
end
exit 16
end
end
Hope this helps.
Rob