clist可以访问GDG,但必须将文件名从gdg相对引用(0)转换为完全限定的数据集名称。在您的考试中,您需要将文件引用为:AAA.BBB.CCC.DDD.G1234V00(其中G1234V00是最新版本的标识符)。
通常,您可以通过编写例程来在数据集上运行LISTCAT命令,SYSTRAPing输出,然后将完全限定名称解析为CLIST变量。
实施例:
PROC 0
/* This illustrates a basic clist method using SYSTRAP */
/* to extract a fully qualified GDG dataset name */
CONTROL NOFLUSH NOPROMPT NOLIST NOCONLIST NOSYMLIST NOMSG MAIN
/* Target dataset name */
SET GDG = 'RAPP.RAP000.YQ.TAX.YQINFO.BK'
/* SET SYSTRAP LIMIT and execute IDCAMS LISTC command */
SET &SYSOUTTRAP = 300
LISTC ENTRIES(&GDG)
/* Calculate line number of last entry in LISTC results */
SET &I = &SYSOUTLINE-21
/* calculate ending position of GDG name in report */
SET &L = &LENGTH(&GDG) + 23
/* extract SYSTRAP data into clist string variable */
SET &C = &&SYSOUTLINE&I
/* substring data from SYSTRAP line into clist variable and list */
SET &D = &SUBSTR(17:&L,&STR(&C))
WRITE &D
END
实施例输出...
RAPP.RAP000.YQ.TAX.YQINFO.BK.G8203V00