Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What is the meaning of PERFORM PARA1 IN PARA2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sairam442
Warnings : 1

New User


Joined: 23 Nov 2006
Posts: 3
Location: banglore

PostPosted: Tue Mar 06, 2007 8:37 am    Post subject: What is the meaning of PERFORM PARA1 IN PARA2
Reply with quote

hi all
pls help me
the fallowing statement is

PERFORM PARA1 IN PARA2

pls tell me the meaning of this one
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Mar 06, 2007 9:21 am    Post subject:
Reply with quote

Hello,

Please post the actual code including a few statements before the perform and both "para1" and "para2".

What you have posted does not conform to any of the standard perform formats. There is an in-line perform, but it is not coded as your example is.

If you'll show more of the code where you found this, we can be more help.
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Wed Mar 07, 2007 8:23 am    Post subject: Re: What is the meaning of PERFORM PARA1 IN PARA2
Reply with quote

Hi sairam,

When u write "PERFORM PARA1 IN PARA2" statement then it treats para1 in para2 as a procedure name and we did not defined any procedure here.

The actual error message is :
"PARA1 OF PARA2" was not defined as a procedure-name. The statement was discarded.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Wed Mar 07, 2007 8:49 pm    Post subject:
Reply with quote

PERFORM PARA1 IN PARA2.
its actually mean that perform a paragraph named PARA1 in section named PARA2

Code:
PROCEDURE DIVISION.
MAIN-SECTION.
     PERFORM PARA1 IN PARA2.
PARA2 SECTION.
PARA1.
     DISPLAY 'HELLO'.
STOP RUN.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Mar 08, 2007 4:35 am    Post subject:
Reply with quote

Hi cobolunni,

You seem to be sure of your ans but I've never run across this usage. Can you please supply the documentary source for this? I'd appreciate it.

I should also say that I've seen it used in the context of elementary variables of the same name residing in two different group levels.

To make them unique you refer to them as being "IN" their respective groups, e.g.:

FLD3 IN GRP1
FLD3 IN GRP2

But I've never seen that PERFORM usage.

Thanx and
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 08, 2007 8:10 am    Post subject:
Reply with quote

Hello,

Was curious myself and decided to put it in some code and see what the compiler did.

The compiler is Enterprise COBOL for Z/OS (3.4.1).

The line of code is
Code:
    PERFORM 020-READ IN 2000-GET-FINAL.

020-READ is a paragraph in the 2000-GET-FINAL SECTION.

This code compiled with no errors or warnings.

Added a second 020-READ in another section.

This compiled with no errors or warnings.

Changed the perform to PERFORM 020-READ.

Compile failed - PROCEDURE NAME "020-READ" WAS MULTIPLY DEFINED".


Makes sense (kinda), but i have no idea where it might be documented icon_smile.gif

Interesting, though most of my sites have standards that say paragraphs must be numbered in ascending sequence. That would eliminate use of this feature.

Thanks Cobolunni icon_cool.gif
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Thu Mar 08, 2007 12:53 pm    Post subject:
Reply with quote

Quote:
Duplicate Paragraph Names

If your program contains duplicate paragraph names, both COBOL systems
will resolve references to the duplicate paragraph names in the same way,
provided the duplicate paragraph names are only referenced from within
the sections in which they are declared. If, however, you reference a
duplicate paragraph name from a different section to the one it is
declared in, the RM/COBOL system will assume that the reference is to the
next declaration of the duplicate paragraph name, whereas this COBOL
system will give an error when you are producing intermediate code.

Solution

To ensure that references to duplicate paragraph names are correctly
resolved, you must qualify a reference to a duplicate paragraph name by
adding the section name in which it is declared.

Example

If your source code contains the following:

....
PERFORM para-2.
....
sect-1 SECTION.
para-1.
....
para-2.
....
sect-2 SECTION.
para-2.
....

the RM/COBOL system will resolve the reference to para-2 in the PERFORM
statement by using the declaration of para-2 in the sect-1 SECTION. Under
this COBOL system, however, you must qualify the reference to the
duplicate paragraph name in your source code by using the PERFORM para-2
OF sect-1 statement.


this is from rm/cobol but found that it works in all type of cobol compilers
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts WER416B Error meaning kbnkb2 SYNCSORT 9 Sat Jul 16, 2016 7:28 pm
No new posts How to perform Digest Access Authenti... vasanthz All Other Mainframe Topics 0 Tue Mar 15, 2016 4:47 pm
No new posts Meaning of low values and high values sandeep kumar302 COBOL Programming 12 Thu Dec 11, 2014 3:37 pm
No new posts Infinite loop Issue in perform Until shankarm COBOL Programming 18 Wed Jul 31, 2013 7:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us