This is another of the little problems which are easy once you know the anwser.
I used the shell program to compile my program.
name=extract
export _C89_CCMODE=1
p1="-Wc,arch(8),target(zOSV2R3),list,source,ilp32,gonum,asm,float(ieee)"
p7="-Wc,ASM,ASMLIB(//'SYS1.MACLIB') "
p8="-Wc,LIST(c.lst),SOURCE,NOWARN64,XREF,SHOWINC -Wa,LIST(133),RENT"
# compile it
xlc $p1 $p7 $p8 -c $name.c -o $name.o
l1="-Wl,LIST,MAP,XREF,AC=1 "
# create an executable in the file system
/bin/xlc $name.o -o $name -V $l1 1>a
extattr +a $name
# create a load module in a PDS
/bin/xlc $name.o -o "//'COLIN.LOAD(EXTRACT)'" -V $l1 1>a
Create an executable in the file system
The first bind xlc step creates an object with name “extract” in the file system.
Specify the load module
The second bind step specified a load module in a PDS. The load module is stored in COLIN.LOAD. If you copy and paste the line, make sure you have the correct quotes ( double quote, //, single quote, dataset(member),single quote,double quote). Sometimes my pasting lost a quote.
Process assembler code
My program has some assembler code…
asm( ASM_PREFIX
" STORAGE RELEASE,...
:"r0", "r1" , "r15" );
It needs the options “-Wc,ASM,ASMLIB(//’SYS1.MACLIB’) ” to compile it, and specify the location of the assembler macros.
Binder parameters
The line parameters in -Wl,LIST,MAP,XREF,AC=1 are passed to the binder.
Message – wrong suffix on the source file
Without the export _C89_CCMODE=1 I got the message
FSUM3008 Specify a file with the correct suffix (.c, .i, .s, .o, .x, .p, .I, or .a), or a corresponding data set name, instead of -o ./extract.