Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

CLIST & REXX :: RE: Need help in REXX CALL program

$
0
0
Author: sergeyken
Posted: Thu Apr 20, 2017 1:31 am (GMT 5.5)

Make "code", and indentation for you

Code:
 DSN='XXXX.DATASET.REPORT'
 "ALLOC DD(INDD) DS('"DSN"') SHR REUSE"
 "EXECIO * DISKR INDD(STEM L. FINIS"
 "FREE DD(INDD)"
 DO I = 1 TO L.0
    FNAME = SPACE(L.I,0)
    SAY FNAME
    CALL DATAINFO
 END I
 EXIT 0

 DATAINFO:
 DSINFO = LISTDSI("'FNAME'")
 IF DSINFO == 0 THEN DO
    SAY 'DATA SET CREATED...........:'SYSCREATE
    SAY 'DATA SET LAST REFERENCED...:'SYSREFDATE
    SAY 'DATA SET EXPIRATION DATE...:'SYSEXDATE
    SAY DSINFO
 END
 ELSE DO
    SAY DSINFO
    SAY 'DATA SET NOT FOUND!!'
 END

 RETURN


Input file:
Code:
 AAA.BBB.CCC
 BBB.CCC.DDD
 CCC.DDD.EEE

Result comes as
Code:
 AAA.BBB.CCC
 16
 DATA SET NOT FOUND!!
 BBB.CCC.DDD
 16
 DATA SET NOT FOUND!!
 CCC.DDD.EEE
 16
 DATA SET NOT FOUND!!
 ***


Now RTFM:
Quote:
16 LISTDSI processing was not successful. An error occurred. None of the variables containing information about the data set can be considered valid, except for SYSREASON. The SYSREASON variable contains the LISTDSI reason code (see Reason Codes).


Quote:
Reason Codes

Reason codes from the LISTDSI function appear in variable SYSREASON. Table 3
shows the LISTDSI reason codes. With each reason code the REXX variable
SYSMSGLVL2 is set to message IKJ584nnI, where nn is the reason code. These
messages are described in z/OS TSO/E Messages.

Table 3. LISTDSI reason codes

Reason code Description

0 Normal completion.

1 Error parsing the function.

2 Dynamic allocation processing error.

3 The data set is a type that cannot be
processed.

4 Error determining UNIT name.

5 Data set not cataloged.

6 Error obtaining the data set name.

7 Error finding device type.

8 The data set does not reside on a direct
access storage device.

9 DFHSM migrated the data set. NORECALL
prevents retrieval.

11 Directory information was requested, but you
lack authority to access the data set.

12 VSAM data sets are not supported.

13 The data set could not be opened.

14 Device type not found in unit control block
(UCB) tables.

17 System or user abend occurred.

18 Partial data set information was obtained.

19 Data set resides on multiple volumes.
Consider using the MULTIVOL keyword to obtain
data set size information totaled across all
volumes.

20 Device type not found in eligible device
table (EDT).

21 Catalog error trying to locate the data set.
. . . . . . . etc . . . . . . . .


Your parameter to LISTDSI is exactly 'FNAME' - I don't think the DSN=FNAME does exist in your system, doesn't it?

It must be:
Code:
 . . . .
 QuotedDSN = "'"FNAME"'"
 DSINFO = LISTDSI(QuotedDSN)
 . . . . . .

_________________
Tyrannosaurus-REXX


Viewing all articles
Browse latest Browse all 8500

Trending Articles