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 Usergroups 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: 10203
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: 2422
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: 2422
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: 10203
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: 2422
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: 10203
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: 10203
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 Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm
No new posts TXT2PDF problem - printing @ in PDF vipul65 All Other Mainframe Topics 9 Thu Aug 25, 2016 12:48 am


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