On 2017-12-24, at 04:51:16, Willy Jensen wrote:                                 
            
> 
> INFO1    dc    y(info1l),C'INFO DD(INFOLIB1)'                            
> info1l   equ   *-info1-2                                                 
> inrtds1  dc    y(44),cl44'INRTDSN'                                       
> 
> INFO2    dc    C'INFO DD(INFOLIB2)',x'00'                                
> inrtds2  dc    y(44),cl44'INRTDSN'                                       
>  
inrtds2 is not null-delimited as it was in David's example.

According to the Ref. manual, you *always* need a byte for the
returned trailing null.  Have you inspected the character after
the returned DSN or tried with a 44-character DSN?

z/OS    IBM Using REXX and z/OS UNIX System Services
Version 2 Release 3

Conventional MVS parameter list
    ...
    Upon return, the return areas will contain a null-terminated string
    for the field requested if it was available and if it fits into
    the area. A null string is returned if the data does not fit into
    the parameter area. The length is set to the length of the data
    returned excluding the terminating null.

    If a keyword value is not returned, a null string is returned.

    Guideline: Because a null-terminated string is returned, in order
    to ensure that the data is returned, the parameter area must be
    large enough for the expected returned data plus the null character.

The C example in this section has lengths of 9 and 45:
    RTARG ddname = {9,"rtddn"};
    RTARG dsname = {45,"rtdsn"}

The Ref. seems to lack an example of calling with returned variables
and a null-terminated parameer string.

-- gil

Reply via email to