how to run a cobol prog?



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

how to run a cobol prog?

Postby Deepak kumar25 » Mon Jan 10, 2011 11:14 am

any one give me suggestion to how i run a cobol program.
Deepak kumar25
 
Posts: 34
Joined: Mon Jan 10, 2011 10:51 am
Has thanked: 0 time
Been thanked: 0 time

Re: how to run a cobol prog? thanx in advance

Postby steve-myers » Mon Jan 10, 2011 11:21 am

You might be better off asking this question in the Cobol area, unless what you really want to know is how to run a Cobol program from a C/C++ program. If this is true the question should be asked in those terms.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: how to run a cobol prog? thanx in advance

Postby dick scherrer » Mon Jan 10, 2011 12:59 pm

Hello and welcome to the forum,

To prevent wasting people's time you need to make sure that your tpoic is posted in the appropriate part of the forum. Your topic has been moved to the COBOL part of the forum.

To learn how to run a program on your system, you should ask a co-worker, your supervisor/mentor, or the technical support people for the system. If you do not understand what they tell you, post what they tell you and your doubt. Someone should be able to clarify.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: how to run a cobol prog? thanx in advance

Postby DOS/VS COBOL Guy » Sat Jan 15, 2011 12:11 am

It depends on the system. On a DOS/VS system on an old IBM mainframe (or on Hercules) you'd code a JCL/JECL script like this:
* $$ JOB JNM=CMPLNKGO,DISP=D,PRI=3,CLASS=0,USER='PROGRAMMER' <== if you are running with POWER/VS, code JECL such as this.
* $$ LST LST=00E,DISP=D,PRI=3,CLASS=Z,FNO=W001,JSEP=1<== if you are running with POWER/VS, code JECL such as this.
// JOB CMPLNKGO
// ASSGN SYSLNK,X'537' <== or wherever your SYSLNK file resides in your standard labels
// ASSGN SYS001,X'537'
// ASSGN SYS002,X'537'
// ASSGN SYS003,X'537'
// ASSGN SYS004,X'537' <== SYS001 - SYS004 are for compiler work files the locations of which must also be defined in your standard labels
// OPTION LINK
// EXEC FCOBOL <== produces a relocatable module input to the linkage editor (LNKEDT)
[Your COBOL source code goes here]
/*
// EXEC LNKEDT <== produces a temporary phase for execution
[if your program uses any files, the // ASSGN, // DLBL and // EXTENT statements for them must be coded here and MUST
match up with the system-names in your COBOL source code]
// EXEC
[any data for a card file goes here]
/*
/&
* $$ EOJ <== if you are running with POWER/VS, code JECL such as this.

z/VSE JCL might be similar to this, but I am 40+ years out of style!

...
DOS/VS COBOL Guy
 
Posts: 10
Joined: Wed Dec 29, 2010 9:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to run a cobol prog? thanx in advance

Postby steve-myers » Sat Jan 15, 2011 12:22 am

It is not possible to answer your question with no knowledge of the data requirements of the program, though z/OS JCL should be simpler than the VSE JCL from DOS/VS COBOL Guy.

You start with an EXEC statement -

// EXEC PGM=your-program

You will probably need a DD statement for the load library where the program has been linked.

//STEPLIB DD DISP=SHR,DSN=your-program-library

You will need more DD statements that depend on the data requirements of your program, which we do not know.

You will need a JOB statement at the start of this JCL, but its contents depend on your site's standards, which we do not know.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: how to run a cobol prog? thanx in advance

Postby DOS/VS COBOL Guy » Sat Jan 15, 2011 12:42 am

steve-myers wrote:It is not possible to answer your question with no knowledge of the data requirements of the program, though z/OS JCL should be simpler than the VSE JCL from DOS/VS COBOL Guy.

You start with an EXEC statement -

// EXEC PGM=your-program

You will probably need a DD statement for the load library where the program has been linked.

//STEPLIB DD DISP=SHR,DSN=your-program-library

You will need more DD statements that depend on the data requirements of your program, which we do not know.

You will need a JOB statement at the start of this JCL, but its contents depend on your site's standards, which we do not know.


I don't normally have to code the // ASSGNs for the compiler work files because my supervisor has those assignments built in and the IPL JCL deck contains an // EXEC for the standard label procedure. Also, the partition initialization JCL contains still more standard assignments, so you don't have to code // ASSGN statements for the card reader, punch or printer so long as you use SYS005, SYS006 and SYS007 respectively for these devices. This makes the JCL simpler than what I have depicted here...
DOS/VS COBOL Guy
 
Posts: 10
Joined: Wed Dec 29, 2010 9:14 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to run a cobol prog? thanx in advance

Postby enrico-sorichetti » Fri Jan 20, 2012 7:02 pm

how can You criticize the answer You received without knowing ? :evil:

anyhow the way You asked was the worst one ...

why not tell the operating system under which You want to run the <thing>

in any case whatever the operating system You need to provide
the info about the datasets/files being used

the syntax on how to provide the above info and the statement to use to run/execute You program depend on the system being used
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: how to run a cobol prog? thanx in advance

Postby NicC » Fri Jan 20, 2012 8:46 pm

Suggest reading the JCL manual for your OS.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: how to run a cobol prog?

Postby jakeferren » Tue Jan 24, 2012 2:12 pm

Depends on the compiler : if u r using cobol-74 u need to go to the DOS prompt : type COBOL <filename>.cob to create executable file then to compile type CRUN <filename> no extension needed this time.
jakeferren
 
Posts: 1
Joined: Fri Jan 20, 2012 6:42 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to run a cobol prog?

Postby BillyBoyo » Tue Jan 24, 2012 2:23 pm

jakeferren, this is a forum for IBM Mainframes. It is unlikely that anyone is using Cobol-74. It is certain that no-one has a "DOS prompt". ".cob" is meaningless in this context. Executable files we call something else. I have no idea as to what you regard as the difference between "creating an executable file" and "compiling".

Next you'll be suggesting we go to PC Cobol fora and start giving useful tips about JCL?

On top of that, there is absolutely no need for the commands you specify being the same in someone-elses system, even ignoring the unlikelihood that they, either, are using Cobol-74.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post