Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ISFACT file allocation error

Status
Not open for further replies.

ShekharBorker

Programmer
Aug 6, 2012
11
GB
Hi,

I have created a REXX utility where the input is a dataset containing names of jobs that are expected to have executed and present in the Spool (SDSF.ST). The utlity then interacts with SDSF to obtain the START DATE, START TIME and END TIME of each job listed in the input dataset.

I do this by invoking the ISFACT command with SA as the action character. I then use EXECIO to browse the ddname present in the first occurrence of the ISFDDNAME. stem, which will be the JESMSGLG section of the job output. I can then obtain the required data from the stem into which EXECIO has written the JESMSGLOG records. Following is the code that does this:

Code:
RC = ISFCALLS("ON")
DO J = JOB_STEM.0 TO 1 BY -1
    ISFPREFIX = JOB_STEM.J
    ISFOWNER = JOB_OWNER
    ADDRESS SDSF "ISFEXEC ST"
    IF RETCODE.J = 'CC 0000' THEN DO
        ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.J"')",
                     "PARM(NP SA)"                               
        "EXECIO * DISKR" ISFDDNAME.1 "(STEM JCL. FINIS"
    END
END
RC = ISFCALLS("OFF")

Note: For the sake of brevity, I have only included the code around the ISFACT command. The actual EXEC has a lot of things happening before and after this part. Also, the EXEC is being run in the batch mode via IKJEFT01

Now the problem occurs about midway through the processing of the input dataset. The SYSTSPRT has several error messages like the one below:

Code:
IRX0555E The input or output file SYS03723 is not allocated.
IRX0670E EXECIO error while trying to GET or PUT a record.

The RC for the ISFACT statement is either 8/20 once the problem starts. In fact, the RC seems to alternate between 8 and 20 for each subsequent call to ISFACT

My analysis of the problem is that ISFACT is requesting the dynamic allocation of datasets but the allocation request is being rejected due to the allocation limit being reached which I think causes the RC 8/20 on the ISFACT statement. Consequently, the EXECIO fails as the DDNAME present in ISFDDNAME.1 hasn't been allocated

I have taken the following actions to try and resolve the issue:

1. I have increased the DYNAMNBR to 3200 at the IKJEFT01 step

2. I have added the FINIS option to the EXECIO because all SDSF SYSOUT datasets have the FREE=CLOSE option set causing datasets to be automatically freed once they are closed by EXECIO

3. I have tried putting a "FREE F(" ISFDDNAME.1 ")" statement after the EXECIO to ensure that datasets are freed after the EXECIO. This way I am doubly (see 2 above) sure that the dataset is freed.

The RCS and EXECIO errors are still present. The workaround to the problem seems to use smaller job lists and execute the REXX multiple times.

Could you please advise if there is a different way to solve / sidestep this problem?

- Shekhar Borker.
 
Hi Nic,

Thanks for your reply.

I am unable to provide the TRACE output at the moment because the jobs are no longer in the spool. I will be running the batch on Wednesday, and I shall post the TRACE results once it completes.

- Shekhar Borker.
 
Don't just 'post' them - analyse them to see what is going wrong and where. If you are unable to determine/understand the cause of your problem from the trace THEN post. If you can fix it from your studies then post waht the error was and your fix. This helps others in the future.


Nic
 
Hi,

I have had a Eureka moment on this one! Although, I am unable to test the solution at the moment, I think I have a plausible explanation for what has gone wrong with the code.

The key observations to solving the problem are the following:

1. When ISFACT is used to execute the SA action character for a job in the spool, all SYSOUT datasets for the job are dynamically allocated.

2. The allocated datsets will be freed when the dataset is opened and then closed by a service like EXECIO (with FINIS option). The other way of freeing the datasets would be to do it explicitly via the FREE command. If neither of these situations occur, the allocated datasets are not freed

3. There is an upper limit on the number of datasets that can be dynamically allocated (something like 3273 or as per the DYNAMNBR specification). Once the limit is reached no more dynamic allocations are possible unless the allocated files are freed. This will result in the failure of subsequent ISFACT SA statements.

From the above observations, I can conclude that the reason for the problem is the following:

I execute ISFACT multiple times, once for each job in the job list. Most of the jobs have at least 4 SYSOUT datasets. However, I only need data from the JESMSGLG dataset. So, I only read ISFDDNAME.1 via the EXECIO service. Due to FINIS option on EXECIO, the dataset is closed. Since, SYSOUT datasets have the FREE=CLOSE option set, the file used to dynamically allocate the JESMSGLOG dataset is automatically freed upon closure. However, the other unsed SYSOUT datasets are not freed. As the jobs in the job list get processed one-by-one, the allocation limit is eventually reached causing subsequent ISFACT statements to return RC=8 or RC=20.

So the EXEC needs to be modified as follows:

Code:
RC = ISFCALLS("ON")
DO J = JOB_STEM.0 TO 1 BY -1
    ISFPREFIX = JOB_STEM.J
    ISFOWNER = JOB_OWNER
    ADDRESS SDSF "ISFEXEC ST"
    IF RETCODE.J = 'CC 0000' THEN DO
        ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.J"')",
                     "PARM(NP SA)"                               
        "EXECIO * DISKR" ISFDDNAME.1 "(STEM JCL. FINIS"
        DO K = 2 TO ISFDDNAME.0
            "FREE F(" ISFDDNAME.K ")"
        END
    END
END
RC = ISFCALLS("OFF")

The FREE statement within the DO Loop ensures that all unused SYSOUT datasets are FREED before the next ISFACT statement is executed.
 
Code:
DO K = 2 TO ISFDDNAME.0
            "FREE F(" ISFDDNAME.K ")"
        END

Allow me to suggest a small mod:

Code:
ddlist = ""
DO K = 2 TO ISFDDNAME.0
        ddlist = ddlist ISFDDNAME.K
        END
"FREE FI(" ddlist ")"

This does all the FREEs with a single SVC99.

Frank Clarke
--America's source for adverse opinions since 1943.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top