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
 

 

What is minimal coding to run a program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
mahaes

New User


Joined: 04 Jul 2006
Posts: 6

PostPosted: Wed Jul 12, 2006 11:05 am    Post subject: What is minimal coding to run a program
Reply with quote

what is minimal coding to run a program...

ie we have code all the four divisions.........
Back to top
View user's profile Send private message

sivaram.ch

New User


Joined: 28 Jun 2005
Posts: 11

PostPosted: Wed Jul 12, 2006 11:42 am    Post subject:
Reply with quote

yes we do have .A standard cobol program consists of 4 divisions.

IDENTIFICATION DIVISION.
PROGRAM-ID.
ENVIRONMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN.

STOPRUN.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Wed Jul 12, 2006 1:24 pm    Post subject:
Reply with quote

Where I work, somebody wrote an EXEC to validate copybooks.
The exec just adds:
Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. DUMMY.
DATA DIVISION.
WORKING-STORAGE SECTION.
before the COPY statement then run the compiler.
It seems PROCEDURE DIVISION is not even mandatory!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Wed Jul 12, 2006 1:29 pm    Post subject:
Reply with quote

But then again, the program is never executed, it's just for validation.
Back to top
View user's profile Send private message
chiranjeevi_mca

New User


Joined: 19 Feb 2006
Posts: 27

PostPosted: Thu Jul 27, 2006 11:34 am    Post subject:
Reply with quote

in vscobol II


id division.
program-id. hai.
procedure division.
stop run.
Back to top
View user's profile Send private message
shivaleela

New User


Joined: 27 Jul 2006
Posts: 3

PostPosted: Sat Jul 29, 2006 1:30 am    Post subject: Re: What is minimal coding to run a program
Reply with quote

Finally, whats the correct answer for this post?
can we run a pgm without the procedure division?



regs
shivaleela
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Sat Jul 29, 2006 1:48 am    Post subject: Re: What is minimal coding to run a program
Reply with quote

The minimum requirement is:
Code:

       IDENTIFICATION DIVISION. 
       PROCEDURE DIVISION.       
           GOBACK.               
Back to top
View user's profile Send private message
satish_r84

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Mon Jul 31, 2006 2:49 pm    Post subject: re minimum requirement for a cobol program to run
Reply with quote

hey u have mentioned GO BACK statement which is used only in COBOL-IMS programs, till my knowledge is concerned.....

but the thing is that, the control on coming to GO BACK, where does the control go????
Back to top
View user's profile Send private message
khannay2k

New User


Joined: 24 Feb 2005
Posts: 28
Location: Bangalore

PostPosted: Tue Aug 01, 2006 10:53 am    Post subject:
Reply with quote

whenever GO BACK command is issued in in a main program(calling pgm) then the control is moved to the operating system, and its MVS here.
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Aug 14, 2006 4:12 pm    Post subject:
Reply with quote

Hi,
Just a little correction,
GOBACK takes the control back to where the program is called from.
In case, the program is called directly from JCL/PROC it takes the control back to the JES.

In case, the program is called from another program GOBACK takes the control back to the calling program.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Mon Aug 14, 2006 5:20 pm    Post subject:
Reply with quote

minimal coding to run a program is
IDENTIFICATION DIVISION.
PROGRAM-ID. NAME.
PROCEDURE DIVISION.
MAIN.
DISPLAY 'HELLO'.
STOP RUN.
DISPLAY statement can be replaced by any statement that can be executed

In the case we only want to compile the program
We can avoid DISPLAY statement

***WRONG ANSWER****
Back to top
View user's profile Send private message
Sridevi_C

Active User


Joined: 22 Sep 2005
Posts: 104
Location: Concord, New Hampshire, USA.

PostPosted: Wed Aug 16, 2006 12:33 am    Post subject: Re: What is minimal coding to run a program
Reply with quote

Satish,
GOBACK can be used in COBOL -DB2 program's also.
Thanks
Back to top
View user's profile Send private message
mahaes

New User


Joined: 04 Jul 2006
Posts: 6

PostPosted: Mon Aug 21, 2006 2:29 pm    Post subject: Minimal code...
Reply with quote

This is the minimal code,

IDENTIFICATION DIVISION
PROGRAM-ID. EXE1.

The minimal code for printing someting on screen is,

IDENTIFICATION DIVISION
PROGRAM-ID. EXE1.
PROCEDURE DIVISION
DISPLAY 'HELLO WORLD'
STOP RUN.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm


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