From: Ralph Bremer on
Hello,

i just want to tell someting about calling BPXWDYN from Cobol on Z/OS ( S/390 MVS ... )
which is importand to know because there are several misleading samples around
which made me even think there would be an error in BPXWDYN ....

BPXWDYN returns a 4-Byte Code with some importand information in the 2 high bytes
and with another information in the low 2 bytes of R15
( see BPXWDYN Documentation at ftp://ftp.software.ibm.com/s390/zos/tools/bpxwdyn/bpxwdyn.html )

however sereral samples use the IBM-Cobol variable RETURN-CODE to test this value.
This is badly wrong because the ibm-Cobol doc tells RETURN-CODE is defined
as PIC s9(4) binary which means a 2-byte value and therfore only getting the 2 low-bytes.

when trying to do some dynalloc with bpxwdyn with error-checking there were several times
an error-message in the log but return-code was zero ....
( for example when using NEW CATALOG with an existing dsn ... )

after finding out about this i defined a variable
bpxwdyn-code pic 9(8) comp-5.
and used
call 'BPXWDYN' using alloc-cmdo returning bpywdyn-code
( alloc-cmdo is the text parameter telling bpywdyn your wishes ... )
now if bpxwdyn-code is zero you konw there was really no error ...

Ralph Bremer

ps.: to respond by mail please remove the .nospam from my address ...