简体   繁体   中英

How to query a file created in qtemp by a submitted job

There is a job that gets submitted. That job calls a program which creates a temporary file in its qtemp. Can someone tell me how to query that file in the qtemp of the job?

The objects within the QTEMP library for a submitted job are not viewable from outside of the job. If you want to actually review the data created within the job by your program, you will need to copy it out to either a work library or library such as "QGPL". So something like the following code snippet would need to be done.

PGM

/* A temporary file is created in QTEMP*/

    CRTPF QTEMP/DATA
    
/* A program is run that populates the file */  

    CALL PGM(PGM1)
    
. . . /* Job continues */

    CPYF FROMFILE(QTEMP/DATA) TOFILE(QGPL/DATA)     /* Save a copy that can be evaluated */
    
ENDPGM  /* The file and library QTEMP for this job is gone*/

Probably the optimal way would be to create an analysis library and then have the batch job copy the file (or files there). Then the files can be removed when no longer needed.

i would do as you suggested & create a library for these temporary files. just remember to clean up after yourself!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM