View previous topic :: View next topic |
Author |
Message |
eskaysem Beginner
Joined: 31 Mar 2003 Posts: 29 Topics: 13
|
Posted: Wed Mar 10, 2010 10:55 am Post subject: Dynamic Paragraph name in Cobol |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Mar 10, 2010 11:44 am Post subject: |
|
|
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 |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Wed Mar 10, 2010 5:02 pm Post subject: |
|
|
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 |
|
|
eskaysem Beginner
Joined: 31 Mar 2003 Posts: 29 Topics: 13
|
Posted: Wed Mar 10, 2010 11:06 pm Post subject: |
|
|
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 |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Thu Mar 11, 2010 5:54 pm Post subject: |
|
|
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 |
|
|
Crox Beginner
Joined: 29 May 2004 Posts: 52 Topics: 9
|
Posted: Thu Mar 25, 2010 6:21 am Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Thu Mar 25, 2010 10:41 am Post subject: |
|
|
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 |
|
|
|
|