Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fujitsu Cobol Programming

Status
Not open for further replies.

klophockey

Programmer
May 25, 2016
41
US
If anyone has some non-proprietary Cobol programs written to compile and run with Fujitsu Cobol, I would be greatly appreciate the opportunity to look them over to give me a better idea of the real world coding that works. I would be interested in looking at various examples and compiling, linking and running those program to learn about Fujitsu Cobol coding as I am absolutely new to this particular flavor

In particular, right now I am trying various things to get part of a program compiling right. Any input from you is most welcome. Thank you.

I thought I had the Select statement coded just fine for a file but it is not happy. Says SELECT clause must be a unique file-name in the description entry of FD. My code is shown below.

IDENTIFICATION DIVISION.
PROGRAM-ID. MYTEST.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.

SELECT XYZ-file ASSIGN TO "XYZ"
ORGANIZATION IS INDEXED
ACCESS IS DYNAMIC
RECORD KEY IS XYZ001
ALTERNATE RECORD KEY IS XYZ001 XYZ002
FILE STATUS IS STATUS-XYZ
LOCK MODE IS AUTOMATIC.


DATA DIVISION.
FILE SECTION.
FD XYZ
LABEL RECORDS ARE STANDARD
RECORD CONTAINS 512 CHARACTERS GLOBAL.
01 REG-XZY.
05 XYZ001 PIC X(4).
05 XYZ002 PIC X(4).
05 XYZ003 PIC X(105).
05 XYZ004 PIC X(11).
05 FILLER PIC X(388).
 
One of the things I am trying to work through is having a main module with copybooks being copied in.
If you have an example of a program that does that, I would appreciate looking at it.
Thank you
 
Do you have a manual for Fujitsu COBOL? That said, if you're on PC, you need to do something like this for files:

Code:
SELECT KJV12 ASSIGN TO "KJV12.TXT"
ORGANIZATION IS LINE SEQUENTIAL.

FILE SECTION.
FD  KJV12
    Record Varying in Size from 1 to 80
    Depending on WS-Char-Cnt
    BLOCK CONTAINS 0 RECORDS.
01  KJV12-REC.
    05  Char Occurs 1 to 80 times
    	Depending on WS-Char-Cnt.
       10  Each-Char   	Pic X.

As it's looking for a specific file name...in this case, a regular text file. Obviously this should point out the compiler error you have as your FD should be "XYZ-file" instead of what you got.

More or less (going to the copybook issue), it's pretty much the same as any other COBOL. The catch is you're going to have to set a dependent association within your project definition in order to catch the CBL you put your copybook material in. For my experience with Fujitsu COBOL (a rather old one a long time ago, v 3.0), I found a lot of the learning curve is more in the compiler options and the project definitions than what happens within the source files themselves.

Hope that helps some...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top