MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamic Paragraph name in Cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Wed Mar 10, 2010 10:55 am    Post subject: Dynamic Paragraph name in Cobol Reply with quote

Is it possible to build a para name at the run time. Alter statement is strictly for forbidden here. Any insght would be really helpful.


Thank you.
Santosh
_________________
Thanks!,
Santosh Kulkarni
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 10, 2010 11:44 am    Post subject: Reply with quote

eskaysem,

Depends on what you really trying to do. Let us know more about what you trying to accomplish and may be we can suggest an alternate approach.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Wed Mar 10, 2010 5:02 pm    Post subject: Reply with quote

Quote:
Is it possible to build a para name at the run time.
If your "run-time" is generating new source code to compile - sure. I suspect this is not what you want to do. . .

Quote:
Alter statement is strictly for forbidden here
As it should be. There is no reason for an application developer to write "self-modifying" code.

As Kolusu mentioned, if you explain what you really want to accomplish, someone may be able to help.
_________________
All the best,

di
Back to top
View user's profile Send private message
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Wed Mar 10, 2010 11:06 pm    Post subject: Reply with quote

Thanks for taking a look at my request. I'm currently designing a program that have 850+ rules and they need to be modularized into a separate paragraph of its own. What am I thinking of is, having the para name as one of the table entry elements, and if the search criteria is met, then I can get paragraph name directly. But then again, I have not seen a perform statement with a "Perform Variable-name". My only concern is currently there are known 850+ rules and in future there my be many more to be added.

Please let me know if I'm unclear.

Thanks
Santosh
_________________
Thanks!,
Santosh Kulkarni
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu Mar 11, 2010 5:54 pm    Post subject: Reply with quote

How large is the data volume to be processed? How many different rules might be used for one "record"?

One way to do what you want is to make each rule a called subroutine and have the subroutine [i]number[/] be part of the module name. On the fly you would build the full name of the module to call and dynamically call the routine.

If you did this, you would minimize changes to the calling module and be able to add a very large number of additional routines. When setting this up, suggest being generous with the parameter area(s). Better to allow for more "passed" data than less so that expansions do not require major re-writes.
_________________
All the best,

di
Back to top
View user's profile Send private message
Crox
Beginner


Joined: 29 May 2004
Posts: 52
Topics: 9

PostPosted: Thu Mar 25, 2010 6:21 am    Post subject: Reply with quote

perhaps too late now, but it is possible to use a go to depending on which works very fast. It can help you to simulate the variable labels you need, just by evaluating a binary field with values from 1 to 255 and jump with the depending on to a place where the hard coded perform is executed.
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Thu Mar 25, 2010 10:41 am    Post subject: Reply with quote

Quote:

perhaps too late now, but it is possible to use a go to depending on which works very fast.


Good suggestion but I would prefer EVALUATE and PERFORM rather than GO TO.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group