CS COBOL

Frequently Asked Questions (and Answers)


Q: I got a zero on my assignment, but I did it. Why?
A: Assignments on BGunix are collected by a computer program at exactly 22:00:00 (10pm) on the due date. If your photo session file was not found in your CS class folder at that time it may be because you did not name it in the specified format or you did not move it from your login folder to your CS folder before the collection deadline. Photo file names are all lower case in the format assign#.photo where # is the assignment number. If you completed the assignment on time but have made one of the above mistakes, you can still get partial credit by emailing the assignment as an attachment to me. Follow the instructions below.

Back   Top


Q: How can I backup my files on BGunix?
A: Follow the procedures below for transferring the file(s) to be backed up to your PC. If you are using the Windows command line FTP program follow these instructions. Use the lcd command in FTP to change to the folder (or thumb-drive) on your PC where you want to back up your file(s) and use the command 'binary' to tell ftp that you want to copy binary data, then use the command 'mget *.*' to move all files to your PC. Skip unwanted files by responding to the confirmation question with 'n' for no.

Back   Top


Q: How do I attach a file to email?
A: Follow the procedures below for transferring the file to be emailed to your PC. Open a new email and look for the "attach file" command or an icon with a paperclip on it. Choose the file that you have just downloaded from BGunix and click OK. Add comments to the body of the email, set the subject and send.

Back   Top


Q: How do I move a program or file from BGunix to my PC?
A: Download and install WinSCP.
Follow the Transfer Procedure.

Back   Top


Q: How can I edit my COBOL program on my PC?
A: Assuming you already have a copy of your program on your PC. Make and save your changes using Notepad++ (preferred), Notepad or WordPad, making sure to save the file with only the .cob extension (not .txt).

On your PC use WinSCP as noted above and connect to "BGunix.bgsu.edu" and login using your BGunix username/password.

Back   Top


Q: The COBOL Compiler reports "Missing Period", what's that and how do I fix it?
A: The compiler scans your program one line at a time. If there is a syntax error in a statement, the compiler will often not recognize the error until it has processed the next statement. It will then report the missing period error on that next statement, but the error really is in the statement that precedes the line reported.

Back   Top


Q: When I run the program I get an "Invalid Decimal Data" (aka "Illegal charater in numeric field") error, what does this mean.
A: The "Invalid Decimal Data" (aka "Illegal charater in numeric field") error is a numeric data exception. It is caused by MOVE 'ing, ADD 'ing, COMPUTE 'ing or comparing (IF'ing) with PIC 9 fields that do not contain valid numeric data. Causes are varied, but among the most common are:
  • MOVE 'ing a PIC X field to a PIC 9 field, including named literals such as SPACES and HIGH-VALUES.
  • Doing computation on a PIC 9 that does not contain numeric data, including fields that contain numeric edit picture characters such as Z and $.
  • READ 'ing a data sensitive data file containing numeric data without indicating "ORGANIZATION IS LINE SEQUENTIAL" in the SELECT statement. The error will always occur processing the second record from the data file.
  • Attempting to process the contents of the DATA-RECORD after End-of-File has been signaled by the AT END clause in the READ statement.

Back   Top


Q: How can I determine what statement caused an error when the program is run?
A: To determine where in your program a run-time error occurs you must run the program using a debugging tool. On BGunix this tool is called "gdb". See documentation here.
Run it as follows:
gdb a.out
run
when the error is encountered the program source line will be displayed*
quit
You can now look at the fields referred to by the reported statement to determine the nature of the problem. It may be necessary to add a DISPLAY statement to the program to see what the field contains prior to the error, but you will need to display the whole record or a group item containing the numeric field to keep from introducing the error on the DISPLAY statement.
*if an error occurs in a SEARCH statement, the line report may be several lines below the SEARCH and will move to a different statement if the reported statement is removed or turned into a comment line.

Top