PROC (perform paragraph) in Easytrieve

As we use paragraph / section in COBOL, that can be executed multiple times using perform statement, we can use PROC in Easytrieve that can be called using PERFORM statement.

Below example will help you understand the syntax of PROC and PERFORM.

 LIST ON
 FILE INMAST FB 4
    IN-NUM 1 4 N
 JOB INPUT INMAST
  PERFORM DISP-LINE
 END-JOB
*
 DISP-LINE. PROC
   DISPLAY 'IN-NUM IS: ' IN-NUM
 END-PROC
*

File INMAST:

0001
0002
0003
0004

the output of this program is

IN-NUM IS: 0001
IN-NUM IS: 0002
IN-NUM IS: 0003
IN-NUM IS: 0004

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.