View previous topic :: View next topic
|
Author |
Message |
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
I am looking for anyone who has done any 64 bit programming in C under z/OS. I am having an 0C1 abend in a simple printf. I suspect that I may have my setup incorrect for the binder or the run-time.
TIA
- Grant |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What does your printf statement look like? |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
I am using C, not C++. My program, in its entirety, is:
#include <stdio.h>
int main() {
printf("Hello world\n");
return 0;
}
My compiler OPTS are:
ARCH(5)
CHECKOUT
DEBUG
DLL
GONUM
LONGNAME
LP64
RENT
SOURCE
SSCOMM
TERM
WARN64
XPLINK
My binder OPTS are:
AMODE=64
CASE=MIXED
DYNAM=DLL
LIST=NOIMP
MAP
RENT
I don't think that I can get any simpler.
TIA |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
What happens when you use :
printf("%s \n","Hello world"); |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
Same thing. Perhaps I am using the wrong libraries?
In my binder invocation, I have:
//STEPLIB DD DISP=SHR,DSN=SYS1.SCEERUN2
// DD DISP=SHR,DSN=SYS1.SCEERUN
//SYSLIB DD DISP=SHR,DSN=SYS1.SCEEBND2
// DD DISP=SHR,DSN=SYS1.SCEELKED
as well as:
INCLUDE OBJECT
INCLUDE SCEELIB(CELQS003)
NAME CTEST(R)
My actual execution is running from my own STEPLIB with the following as concatenations:
SYS1.SCLBDLL2
SYS1.SCEERUN2
SYS1.SCEERUN |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
it worked for me
Code: |
#include <stdio.h>
int main(){
#ifdef _LP64
printf("hello from the 64bits world\n");
#else
printf("hello from the good old world\n");
#endif
} |
using the default procedure EDCQCBG. in the link I posted before
I had to tweak it a bit because of a jcl error allocating a temporary dataset with dsntype library
Code: |
SAVE MODULE ATTRIBUTES:
AC 000
AMODE 64
COMPRESSION NONE
DC NO
EDITABLE YES
EXCEEDS 16MB NO
EXECUTABLE YES
MIGRATABLE NO
OL NO
OVLY NO
PACK,PRIME NO,NO
PAGE ALIGN NO
REFR NO
RENT YES
REUS YES
RMODE ANY
SCTR NO
SSI
SYM GENERATED NO
TEST NO
XPLINK YES
MODULE SIZE (HEX) 000008B8
DASD SIZE (HEX) 00011000 |
and here is the output
Code: |
hello from the 64bits world |
|
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Nice one, Enrico. |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
Enrico -
Thanks. I will do some more testing. When you ran the binder, was the output to a PDS or a PDS/E?
I was using a PDS/E. When I tried link to a PDS, I get the following message from the binder:
IEW2606S 4B39 MODULE INCORPORATES VERSION 3 PROGRAM OBJECT FEATURES AND CANNOT BE SAVED IN LOAD MODULE FORMAT. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
PDSE ..
that's the reason for my remark about dsntype library for temporary datasets
it' s correct You need to have a PDSE for long names and all the C horse manure |
|
Back to top |
|
|
Grant Goodale
New User
Joined: 13 Nov 2010 Posts: 67 Location: Brampton, Ontario, Canada
|
|
|
|
This is almost beyond belief! Up until now, my PARM field for the C compiler (CCNDRVR) was:
PARM='OPTFILE(DD:OPTIONS)'
I then changed it to:
PARM='/CXX OPTFILE(DD:OPTIONS)'
Now, everything works
Many thanks to Enrico and Peter for your help. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Glad that the issue was solved,
thank You for telling! |
|
Back to top |
|
|
|