Hi This is the code that I have created
OPTIONS MISSING = ' ' SYMBOLGEN; %LET PDSNAME = %ADDTICKS(testpds.jcllib); DATA PDSCHK; _RC = FILENAME("MYPDS",&PDSNAME); _DID = DOPEN("MYPDS"); IF _DID NE 0 THEN DO; PUTLOG "ERROR: UNABLE TO OPEN PDS TO LOOK MEMBERS IN IT"; _RC = FILENAME("MYPDS"); /* STOP; */ END; ELSE DO; PUTLOG "PDS opened successfully"; END; DO _I = 1 TO DNUM(_DID); MEMBERNAME = DREAD(_DID,I); _RC = FILENAME("THISMEM",CATS("MYPDS(",MEMBERNAME,")","S")); _FID = FOPEN("THISMEM");
DO _J = 1 TO FOPTNUM(_FID); INFONAME = FOPTNAME(_FID,_J); INFOVALUE = FINFO(_FID,INFONAME); OUTPUT; END; _RC = FCLOSE(_FID); _RC = FILENAME("THISMEM"); END; _RC = DCLOSE(_DID); _RC = FILENAME("MYPDS"); RUN;
The log is
NOTE: Variable I is uninitialized. ERROR: UNABLE TO OPEN PDS TO LOOK MEMBERS IN IT NOTE: Argument 2 to function DREAD(1, ) at line 41 column 19 is invalid. NOTE: Argument 1 to function FOPTNUM(0) at line 44 column 19 is invalid. ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing, zero, or invalid. _RC=20002 _DID=1 _I=1 MEMBERNAME= I= _FID=0 _J=1 INFONAME= INFOVALUE= _ERROR_=1 _N_=1 NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values. Each place is given by: (Number of times) at (Line):(Column). 1 at 44:19
... View more