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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerCobol V4 sample programs wanted

Status
Not open for further replies.

waycon

Technical User
Sep 4, 2002
17
0
0
US
In my former life I wrote business applications in COBOL. CIRCA late 1970's and 80's. This was the old style "green screen" COBOL.

I was pretty good at it, but I've been out of the business for sometime. I now have a need to write some custom business apps. To learn what today's COBOL is like I purchased a book, "Mastering COBOL" which included Fujitsu COBOL, POWERCOBOL V4 and other goodies. It also included sample programs to work with, but they are V3 and will not convert.

The publisher will refund the cost of the book, but cannot supply the sample programs.

Can anyone share some simple business programs. Idealy, I would like something that handles screen input, accesses files with sequential, relative or ISAM orgganization and prints reports.

Any help will be appreciated. The Fujitsu manuals are great, but I need some practical examples.

Thanks
 
You can download it from adtools support (sample program)
Fsccdm
 
goto....
here is a simple example.....

@OPTIONS MAIN
IDENTIFICATION DIVISION.
PROGRAM-ID. PATLIST.
* PROGRAMMER: Me
* DATE WRITTEN: 08/21/2002
* DATE DUE: 09/05/2002

* THIS PROGRAM PRINTS A PATRON ADDRESS LIST
* USING COBOL-74

ENVIRONMENT DIVISION.

CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-PC.
OBJECT-COMPUTER. IBM-PC.

INPUT-OUTPUT SECTION.

FILE-CONTROL.
SELECT PATRON-FILE
ASSIGN TO "C:\PATRON~1.DAT"
ORGANIZATION IS LINE SEQUENTIAL.
SELECT PATRON-LIST
ASSIGN TO PRINTER.
* USE THIS SELECT STATEMENT FOR PATRON-LIST INSTEAD OF THE
* ONE ABOVE TO SEND OUTPUT DIRECTLY TO YOUR PRINTER.
* SELECT PATRON-LIST
* ASSIGN TO PRINTER "PRN-FILE".

DATA DIVISION.

FILE SECTION.

FD PATRON-FILE
LABEL RECORDS ARE STANDARD.

01 PATRON-RECORD.
05 PR-NAME PIC X(18).
05 PR-ADDRESS PIC X(18).
05 PR-CITY-STATE-ZIP PIC X(24).
05 PR-TARGET-CONTR PIC 9(4).
05 PR-ACTUAL-CONTR PIC 9(4).

FD PATRON-LIST
LABEL RECORDS ARE OMITTED.

01 PATRON-LINE.
05 FILLER PIC X(1).
05 PL-NAME PIC X(18).
05 FILLER PIC X(1).
05 PL-ADDRESS PIC X(18).
05 FILLER PIC X(1).
05 PL-CITY-STATE-ZIP PIC X(24).

WORKING-STORAGE SECTION.

01 SW-SWITCHES.
05 SW-EOF-SWITCH PIC X(3).

PROCEDURE DIVISION.

000-PRINT-PATRON-LIST.
OPEN INPUT PATRON-FILE
OUTPUT PATRON-LIST
MOVE "NO " TO SW-EOF-SWITCH
PERFORM 200-PROCESS-RECORD
UNTIL SW-EOF-SWITCH IS EQUAL TO "YES"
CLOSE PATRON-FILE
PATRON-LIST
STOP RUN.

200-PROCESS-RECORD.
READ PATRON-FILE
AT END
MOVE "YES" TO SW-EOF-SWITCH.
IF SW-EOF-SWITCH IS EQUAL TO "NO "
MOVE SPACES TO PATRON-LINE
MOVE PR-NAME TO PL-NAME
MOVE PR-ADDRESS TO PL-ADDRESS
MOVE PR-CITY-STATE-ZIP TO PL-CITY-STATE-ZIP
WRITE PATRON-LINE
AFTER ADVANCING 2 LINES.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top