mvslovers/brexx370

dir() function does not work.

Closed this issue · 3 comments

The dir() function appears to be non-functional and also does not return an error when pointed at a non-existent data set.

for example:
rx - a = dir('hmvs01.clist'); call listit

List all Variables
[0001] "A" => ""

I have tried a few variations on this like CALLing the function instead of direct assignment, or using a DD name to no avail.

The dsn in the DIR function must be enclosed in quotes, else the user hlq is added.
Please try the following simple REXX:

call dir("'"BREXX.V2R4M0.RXLIB"'")
SAY "PO DATASET "DSN" HAS "DIRENTRY.0" MEMBERS:"
SAY ""
DO II=1 TO DIRENTRY.0
SAY "0 "DIRENTRY.II.LINE
SAY "1 "DIRENTRY.II.name
END
call listit

Ah! Quotes in quotes. Much obliged.

We added a return code to check the status of DIR:
rc 0: dir was successfully processed
8: dir command failed, possible reason directory not present, or missing authority to process it
Code change will be available in BREXX V2R4M1 or BREXX.V2R5M0