clist는 GDG에 액세스 할 수 있지만 파일 이름을 gdg 상대 참조 (0)에서 정규화 된 데이터 세트 이름으로 변환해야합니다. 오류가있는 경우 파일을 다음과 같이 참조해야합니다. AAA.BBB.CCC.DDD.G1234V00 (여기서 G1234V00은 최신 버전 식별자 임).
일반적으로 데이터 세트에 LISTCAT 명령을 실행하고 출력을 SYSTRAP 처리 한 다음 완전한 이름을 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