View previous topic :: View next topic
|
Author |
Message |
Padmanabharao Pokuri
New User
Joined: 29 Jun 2011 Posts: 5 Location: Eden Prairie
|
|
|
|
Hi,
I have C++ program on z\OS
EDIT hello.cpp
Command ===>
****** ***************************** Top of Data *******
000001 #include <iostream>
000002 int main( int argc, char **argv )
000003 {
000004 std::cout << "Hello World" << std::endl;
000005 return 0;
000006 }
****** **************************** Bottom of Data *****
Could anybody suggest step by step how to compile & run above program in z\OS environment.
Thank you
Pokuri |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
- Go to you colleagues
- Ask them
- Follow their advice
|
|
Back to top |
|
|
Padmanabharao Pokuri
New User
Joined: 29 Jun 2011 Posts: 5 Location: Eden Prairie
|
|
|
|
Thanks for you time. I tried with my colleagues but no use. Finally i posted. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1787 Location: Bloomington, IL
|
|
|
|
Let us discuss this problem a little:
- Given that none of your colleagues have any idea of how to compile a C++ program, is this the first instance of the use of C++ in your shop?
- If this is the first instance of its use, are you (or is anyone) actually authorized to use C++, or is the end result of this venture going to be you sliding along the sidewalk, a pink slip in your hand and a footprint on your arse?
- If you are authorized to use C++, why have not your system programmers provided you with the necessary suite of tools and the documentation to use and understand them?
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Quote: |
I tried with my colleagues but no use. |
Well, remarkably, I didn't know that.
It is possible that this is something you are not supposed to do.
Do you know any of the techies? Did you check with you boss?
You got a PC at home? You can learn C++ on that.
If you are allowed to do it, but no-one knows how(!) you can probably get it from a manual.
Just make sure you are allowed to do it first. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Does anyone on the system know how to compile a COBOL program? The process will be quite similar for c++ (assuming the compiler is installed and you are permitted to use it).
Suggest you speak with the prople who support the standard COBOL compile/link process(es) to help set up what you need. It will be site-specific. |
|
Back to top |
|
|
mtaylor
Active User
Joined: 20 Feb 2009 Posts: 108 Location: Kansas City
|
|
|
|
I used to try and do that, you can usually run 'cc' from the omvs prompt. The problem comes when specifying the linker args for anything other than stdlib.h (it seemed to link by default); I could never find the include dirs. There are c/c++ programming guide/lang reference in the ibm manuals, you should be able to piece it all together from those.
You also might want to think about switching to a job that let's you work with newer tech though, there's a place for people with your curiosity and enthusiasm 'outside the box' and it's rarely in mainframe shops (imo). |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
JCL examples are to be found in :
z/OS XL C/C++Programming Guide SC09-4765 |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
This still confuses me a bit. I know that there is some Operating System called "Z/OS something" that looks a lot like a Linux box. It has all the bells ans whistles you'd see on a Linux server, like Java man pages and shell environments.
Then there is the COBOL-style "Z/OS something" where programs like TSO and IMS and VSAM live.
When I see a question like this one, I know that I have compiled and run programs written in C++ in the same universe where my COBOL programs live. The compile JCL looks similar and the program lives in a normal PDS as an executable load module.
However, I wonder if this TS is running in a Linux universe. Would the folks reading this be able to tell? |
|
Back to top |
|
|
Padmanabharao Pokuri
New User
Joined: 29 Jun 2011 Posts: 5 Location: Eden Prairie
|
|
|
|
Thanks for all.
I am able to compile & run the program in OMVS.
000001 //
000002 // Sample Program: Hello World
000003 #include <iostream>
000004 using namespace std;
000005 int main()
000006 {
000007 cout << "Hello World \n";
000008 return 0;
000009 }
:/u/pokuri: >./hello
Hello World
But i am not able to compile & run the same program thru Batch Job (JCL) in TSO environment. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I believe the default name -- which can be changed when installed at a site -- for the PDS with the compile JCL is CBC.SCCNPRC and the member would be CBCCB or CBCCL depending upon whether you are binding or prelinking/linking.
If you can compile in OMVS, you can use BPXBATCH to do the same in a batch job.
As always, contact your site support group for assistance since the compile process depends very much upon the specifics of the site and how their standard compile processes are put together. |
|
Back to top |
|
|
Padmanabharao Pokuri
New User
Joined: 29 Jun 2011 Posts: 5 Location: Eden Prairie
|
|
|
|
I am able to compile in OMVS and run batch job using BPXBATCH.
But Now i am trying to compile & Run thru Batch job using CBC.SCCNPRC. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
But Now i am trying to compile & Run thru Batch job using CBC.SCCNPRC. |
and... where is the question ? |
|
Back to top |
|
|
Padmanabharao Pokuri
New User
Joined: 29 Jun 2011 Posts: 5 Location: Eden Prairie
|
|
|
|
Thanks for all your help.
Now i am able to run the C++ programs in TSO environment thru Batch job. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for letting us know
d |
|
Back to top |
|
|
|