IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Having a problem with 64 bit C under z/OS


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 5:48 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Nov 15, 2010 1:43 pm
Reply with quote

what happened when You tried to run the simple Hallo World from
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/cbcug170/9.5.5?ACTION=MATCHES&REQUEST=EDCQCBG&TYPE=FUZZY&SHELF=CBCBS190&DT=20080708122353&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 3:18 pm
Reply with quote

What does your printf statement look like?
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 7:32 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 10:18 pm
Reply with quote

What happens when you use :

printf("%s \n","Hello world");
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 10:29 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Nov 15, 2010 10:42 pm
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 10:52 pm
Reply with quote

Nice one, Enrico.
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 11:00 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Nov 15, 2010 11:05 pm
Reply with quote

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 icon_biggrin.gif
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Tue Nov 16, 2010 12:41 am
Reply with quote

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 icon_biggrin.gif

Many thanks to Enrico and Peter for your help.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Nov 16, 2010 12:44 am
Reply with quote

Glad that the issue was solved,
thank You for telling!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
No new posts Need to add field to copybook, proble... COBOL Programming 14
Search our Forums:

Back to Top