Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Having a problem with 64 bit C under z/OS

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

New User


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

PostPosted: Mon Nov 15, 2010 5:48 am    Post subject: Having a problem with 64 bit C under z/OS
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Mon Nov 15, 2010 1:43 pm    Post subject: Reply to: Having a problem with 64 bit C under z/OS
Reply with quote

what happened when You tried to run the simple Hallo World from
http://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: 2441
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 3:18 pm    Post subject:
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: 55
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 7:32 pm    Post subject:
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: 2441
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 10:18 pm    Post subject:
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: 55
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 10:29 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Mon Nov 15, 2010 10:42 pm    Post subject: Reply to: Having a problem with 64 bit C under z/OS
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: 2441
Location: Netherlands, Amstelveen

PostPosted: Mon Nov 15, 2010 10:52 pm    Post subject:
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: 55
Location: Brampton, Ontario, Canada

PostPosted: Mon Nov 15, 2010 11:00 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Mon Nov 15, 2010 11:05 pm    Post subject: Reply to: Having a problem with 64 bit C under z/OS
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: 55
Location: Brampton, Ontario, Canada

PostPosted: Tue Nov 16, 2010 12:41 am    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Tue Nov 16, 2010 12:44 am    Post subject: Reply to: Having a problem with 64 bit C under z/OS
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us