This might be helpful--I use this to compile COBOL and put it in /APACHE/PUB/cgi-bin;
I call this proc CSMC, but anywill do (and it helps if you have SM):
PARM PROG,SUFF="CC"
COB85XL !PROG!SUFF
LINK $OLDPASS;TO=./!PROG;RL=/lib/libc.a ;posix ;share
PURGE !PROG
COPY ./!PROG , !PROG
PURGE /APACHE/PUB/cgi-bin/!PROG
COPY ./!PROG , /APACHE/PUB/cgi-bin/!PROG
XEQ /SYS/HPBIN/CHMOD;INFO=" 777 /APACHE/PUB/cgi-bin/!PROG"
The trick here is to pass the program name in lower case, as in:
CSMC csm890
which will compile CSM890CC and output /APACHE/PUB/cgi-bin/csm890 with permissions of 777.
Note that this assumes that you have access to the /lib/libc.a as well.