简体   繁体   English

AS400:如何知道哪个程序创建文件?

[英]AS400: How to know which program create a file?

I am not expert about AS400 , just know some commands and i exporti some files from AS400 (iSeries) into SQL Server 2005. 我不是AS400方面的专家,只是知道一些命令,我​​将一些文件从AS400(iSeries)导出到SQL Server 2005。

Actually i need to know which RPG Program created a file in a library. 实际上,我需要知道哪个RPG程序在库中创建了文件。 This because that file contains statistic data from other files stored in other AS400 libraries. 这是因为该文件包含来自其他AS400库中存储的其他文件的统计数据。

This screenshot show the file STTMVF in the library DAT_4DWH (by DSPLIB DAT_4DWH ) 该截图显示文件STTMVFDAT_4DWH (由DSPLIB DAT_4DWH

在此处输入图片说明

So there are a command that let me know which RPG program created the file STTMVF ? 因此,有一条命令让我知道哪个RPG程序创建了文件STTMVF?

If yes i need to open the source RPG or CL and try to understand which phisical files are used to compose this statistic file. 如果是,我需要打开源RPG或CL并尝试了解使用了哪些物理文件来构成此统计文件。

Thanks in advance! 提前致谢!

You can use journal management or program references to determine what is writing to the file. 您可以使用日记管理程序引用来确定正在写入文件的内容。


Journal management 期刊管理

Starting the journal 开始日记

To create a basic journal you need to create a journal receiver, a journal, and activate journalling for the file. 要创建基本日记帐,您需要创建日记帐接收者,日记帐并激活文件的日记帐。 Replace RECEIVER-LIB , RECEIVER-FILE , JOURNAL-LIB , JOURNAL-FILE , FILE-LIB and FILE with values appropriate for your system. 更换接收器LIB, 接收器文档期刊-LIB, 作者-FILE, 文件LIB 文件 ,适用于您的系统值。

CRTJRNRCV JRNRCV(RECEIVER-LIB/RECEIVER-FILE)
CRTJRN JRN(JOURNAL-LIB/JOURNAL-FILE) JRNRCV(RECEIVER-LIB/RECEIVER-FILE)
STRJRNPF FILE(FILE-LIB/FILE) JRN(JOURNAL-LIB/JOURNAL-FILE) OMTJRNE(*OPNCLO)

Dumping the journal 转储日记

DSPJRN JRN(JOURNAL-LIB/JOURNAL-FILE) FILE(FILE-LIB/FILE) RCVRNG(*CURCHAIN) JRNCDE(R) ENTTYP(PT PX DL UP) OUTPUT(*OUTFILE) OUTFILFMT(*TYPE1) OUTFILE(QTEMP/QADSPJRN)

Querying the journal 查询日志

The field JOPGM will contain the program name that inserted, updated, or deleted records from the file. JOPGM字段将包含从文件中插入,更新或删除记录的程序名称。

Removing the journal 删除日记

ENDJRNPF FILE(FILE-LIB/FILE)
DLTJRN JRN(JOURNAL-LIB/JOURNAL-FILE)

Program references 程序参考

Dumping the references 倾销参考

DSPPGMREF PGM(*ALLUSR/*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/QADSPPGM)

Querying the references 查询参考

Search the file for all references where the field WHFNAM equals FILE . 在文件中搜索WHFNAM字段等于FILE的所有引用。 The field WHPNAM will contain the program name. WHPNAM字段将包含程序名称。 Due to file overrides, etc this method is not as accurate as using a journal. 由于文件覆盖等原因,此方法不如使用日志准确。

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

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