IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to compile and execute COBOL program within Windows OS


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
flyingSnail

New User


Joined: 15 Jun 2005
Posts: 5
Location: China

PostPosted: Thu Jun 16, 2005 8:21 am
Reply with quote

In order to self-study COBOL programming technique, I need to test some COBOL programs on my PC. But I don't know how to build such a environment. I need your help. Thank you
Back to top
View user's profile Send private message
lucky

New User


Joined: 01 Jun 2005
Posts: 12
Location: Croatia

PostPosted: Thu Jun 16, 2005 12:12 pm
Reply with quote

Hi!

I think that the best way would be to get IBM VisualAge for COBOL, or Microfocus Net Express (ww.microfocus.com). They are both compatible with MF COBOL.

There are also some other solutions, like TinyCOBOL but they are compatilble with MF COBOL.

Check Mainframe Downloads

These are the ones I used...
Back to top
View user's profile Send private message
sudheer648

New User


Joined: 23 May 2005
Posts: 97
Location: Chennai

PostPosted: Thu Jun 16, 2005 12:33 pm
Reply with quote

Hi flyingSnail,

I am pretty not sure how they compile in case of pc cobol.

But running is done with a command called RUNCOB i remember.
Back to top
View user's profile Send private message
flyingSnail

New User


Joined: 15 Jun 2005
Posts: 5
Location: China

PostPosted: Thu Jun 16, 2005 5:15 pm
Reply with quote

Hi lucky and sudheer648,

Thanks for your help. Very happy to get your warm help.
Back to top
View user's profile Send private message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Wed Jul 06, 2005 9:41 am
Reply with quote

hi
well it totally depends upon the compiler u have got . Since i have got a compiler which runs as
create a folder in any of your drive c: , d: with name as cobol
then on command prompt type cobol followed by filename saved with .cob extension.
After compiling type runcob followed by filename which has been compiled in previous step.

This will work

Regards
Vishal
Back to top
View user's profile Send private message
vini_srcna

Active User


Joined: 26 May 2005
Posts: 178
Location: Copenhagen, Denmark

PostPosted: Fri Jul 08, 2005 4:38 pm
Reply with quote

hi,

iam having an idea to do it with cobol 85 compiler. but u should get the compiler from downloads. its approximately around 800kb. copy this compiler into any of ur drives(c,d..). after this go to command prompt and enter this compiler directory. type the command edit, u will get an editor where u can type in the cobol pgm after tat save it with a .cob extension. after these steps come back to dosprompt by using the keys Alt+f+x. then type the command cobol3 filename.cob now this shows the pgm along with errors and warnings . if its free of errors type the command crun3 filename (without extension) u will be able to see the output.

regards
vinay
Back to top
View user's profile Send private message
parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon Jul 11, 2005 12:03 am
Reply with quote

Hi,

I use microfocus cobol compiler for DOS/ windows.

Infact you can find a cobol compiler from
www.ibmmainframes.com/downloads.html

All you need to do is to extracts the zip file into your c: or d: ... drives
and then, open up your command prompt
1. Start--> run --> cmd ( for windows NT, xp, 2K)
and chage to your cobol directory
e.g.
c:\>cobol\
2. Edit your cobol program using your favourite editor , like EDIT, notepad ...etc.
3. To compile your programm,

cobol programname.cbl
it will give you three prompts for naming the obj , list etc files.

You can avoid this by putting semicolon after your command
cobol programname.cbl ;

4. You need to link your program
link programname ;

Note that you shouldn't include .cbl or .obj extension here in link command

5. If everything is okay, you should have programname.exe file generated which is your executible module.


Well, running Microfocus cobol compiler on unix boxes like IBM aix is little different

1. cob programname.cbl
or
cob -u programname.cbl

This compiles and links the program
2. runcob programname

This runs the program

Let me know if you need any further clarification.
Back to top
View user's profile Send private message
venu.pamulapati

New User


Joined: 23 Oct 2010
Posts: 5
Location: bangalore

PostPosted: Wed Nov 03, 2010 5:58 pm
Reply with quote

Hi any body could u please send m th link how to work cobol compler in desktop ?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 03, 2010 6:05 pm
Reply with quote

www.google.nl/search?hl=nl&rls=com.microsoft%3Aen-us&rlz=1I7SKPB_en&q=cobol+compiler+desktop&btnG=Zoeken&aq=f&aqi=&aql=&oq=&gs_rfai=
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Nov 03, 2010 6:05 pm
Reply with quote

Enrico ------------- statistics please icon_lol.gif
Back to top
View user's profile Send private message
venu.pamulapati

New User


Joined: 23 Oct 2010
Posts: 5
Location: bangalore

PostPosted: Wed Nov 03, 2010 6:10 pm
Reply with quote

tx for sending the link mr.PeterHolland


one mor thing how work on this ?


is there any on line compiler to work cobol programs
?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 03, 2010 6:47 pm
Reply with quote

sorry for sleeping on the job icon_biggrin.gif


Code:
The topic has been resurrected after
...          5 year(s) - (months difference / 12 )
...          5 year(s) - (difference )
...         64 months
...       1941 days
...      46601 hours
...    2796115 minutes
...  167766900 seconds
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 03, 2010 6:51 pm
Reply with quote

for those interested here the REXX script


Code:
#!/opt/ooRexx/bin/rexx
numeric digits 24

parse arg how

tmsto = "Jul 10, 2005 7:33 pm "
tmstn = "Nov 03, 2010 1:28 pm"


parse var tmsto mnth gday "," year hh ":" mm pm
hh = right( hh // 12 , 2 , 0)
if  pm = "pm" then ,
    hh = right( hh + 12 , 2 , 0)
dateo = date("s", gday mnth year, "n") || "-" || hh || ":" || mm || ":00"

parse var tmstn mnth gday "," year hh ":" mm pm
hh = right( hh // 12 , 2 , 0)
if  pm = "pm" then ,
    hh = right( hh + 12 , 2 , 0)
daten = date("s", gday mnth year, "n") || "-" || hh || ":" || mm || ":00"

diff = d2s(daten) - d2s(dateo)

say.0 = 7
say     "The topic has been resurrected after"
say.1 = "..." right(diff,10) ,
              "seconds"
say.2 = "..." right(diff % ( 60 ),10) ,
              "minutes"
say.3 = "..." right(diff % ( 60 * 60 ),10) ,
              "hours"
say.4 = "..." right(diff % ( 60 * 60 * 24 ),10) ,
              "days"
say.5 = "..." right(( substr(daten,1,4)*12 + substr(daten,5,2) ) - ,
                    ( substr(dateo,1,4)*12 + substr(dateo,5,2) ),10) ,
              "months"
say.6 = "..." right(substr(daten,1,4) - substr(dateo,1,4),10) ,
              "year(s) - (difference )"
say.7 = "..." right(( ( substr(daten,1,4)*12 + substr(daten,5,2) ) - ,
                      ( substr(dateo,1,4)*12 + substr(dateo,5,2) ) ) % 12,10) ,
              "year(s) - (months difference / 12 )"

if how = "" then ,
    parse value 1 say.0 "-1" with t f s
else ,
    parse value 1 say.0  "1" with f t s

do  i = f to t by s
    say say.i
end

exit

d2s:procedure
   parse arg dt
   parse var dt d "-" h ":" m ":" s
    return date("b",d,"s")*(24*60*60) + h * 60 * 60 + m * 60 + s
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 03, 2010 6:54 pm
Reply with quote

Enrico, where are the milli-seconds?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Nov 03, 2010 7:20 pm
Reply with quote

I did not post the milliseconds because it was just a row with the seconds multiplied by 1000

no visual change in the rows pattern icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Nov 03, 2010 10:14 pm
Reply with quote

Enrico,

that i understand. But multyplying by 1000 gives me a head ache. Please take my age in account. icon_mad.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top