BGSU Logo
BGSU Home BGSU Academics BGSU Admissions The Arts BGSU Athletics Libraries Offices
Department of Computer Science
Computer Science Home Undergraduate Program Graduate Program Computer Science Faculty Academic Advising Mission and Vision
Small font Medium font Larger font Largest font
Left bracket Using COBOL IN VISUAL STUDIO Right bracket

These steps show you how to compile and execute a COBOL program using Visual Studio.

  1. Start Microsoft Visual Studio.
  2. Choose File | New | Project and you will see this screen:
    New Project
  3. Click on COBOL Projects in the left pane and click on Console Application in the right pane. Be sure that the top right corner says .NET Framework 3.5. Fill in the project name (Name:) and click the Browse button to select a directory for your project. Select a location on your personal hard disk or on a USB flash drive in a computer lab. Be sure that the box labeled "Create directory for solution" is unchecked. A new folder will be created in the specified location with the project's name. Then click OK. For this example, we assume drive D is the flash drive we are using.
  4. You will see that a program skeleton has already been written for you. If you like, you can erase all that code. If you want to use free format to enter your code (that is, you don't want to follow the strict column rules, click on the last item in the Project menu (the last word will be Properties). You will see the following:
    Properties Change the Source Format setting to be Free. Click File | Close to remove the Properties window.
  5. You are now ready to type your program. To compile your program, click Build | Build Solution.
  6. If there are error messages in the bottom window, double-click on each message to go to the location of the error in your file. Fix the errors and build your program again.
  7. Execute your program by pressing Ctrl-F5 or clicking Debug | Start Debugging.

Use one of the following strategies to return to your project after closing Visual Studio:

  1. double-click the solution file (which ends in extension .sln), or
  2. choose Open | Project/Solution from the File menu and choose the solution file (ends in .sln), or
  3. select the solution from Recent Projects at the bottom of the File menu.

webmaster@cs.bgsu.edu