简体   繁体   English

如何查询提交的作业在 qtemp 中创建的文件

[英]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.该作业调用一个程序,该程序在其 qtemp 中创建一个临时文件。 Can someone tell me how to query that file in the qtemp of the job?有人可以告诉我如何在作业的 qtemp 中查询该文件吗?

The objects within the QTEMP library for a submitted job are not viewable from outside of the job.已提交作业的 QTEMP 库中的对象无法从作业外部查看。 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".如果您想实际查看您的程序在作业中创建的数据,则需要将其复制到工作库或“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!只记得自己清理干净!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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