View previous topic :: View next topic
|
Author |
Message |
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Hi,
I have an if condition which is common across many programs.
IF model = 'A' or 'B'
This condition is changed often which means all programs using this condition has to be changed. My doubt is : Can we have procedure copybook in easytrieve.
I want to modify all programs to use this copybook so that I can just make changes to this copybook alone. I know that %copybook can be used for copying a layout. I did try to use this in job section but it is giving errors. Do we have a procedure division copybook in easytrieve? Or wat can be a better way to deal with this
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Where is the Easytrieve source stored?
There is no "procedure copybook" built into Easytrieve that i'm aware of, but there may be some alternatives. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
You could define a MACRO. |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
I want to create this IF condition also dynamically on a daily basis. So my file will have the IF condition. Can we use a macro in a program that is in a PS file and not the production library?
Would be great if someone can give the link for easytrieve manual. Need to learn about macros. |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Easytrieve source is stored in panvalet library and is executed like EXEC PGM=PGMNAME and not in parms. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Would be great if someone can give the link for easytrieve manual. Need to learn about macros. |
If your organization is licensed to use the product, all of the material may be downloaded free from CA Support. We may neither post the material nor a link to it in our forum.
Quote: |
Easytrieve source is stored in panvalet library and is executed like EXEC PGM=PGMNAME and not in parms. |
So, you are running compiled Easytrieve? Or is PGM= the Easytrieve executable of your own linkedited module?
Something to consider might be to make this test a common callable module and invoke it from each Easytrieve module that needs the comparison. The common module would be modified/recompiled as needed. |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Yes. It is a compiled Easytrieve. I thought about creating a subprogram but the problem is for every record in input, I need to call this submodule and might b a performance issue.
This is the flow of the easytrieve program.
Read model from input file
{
Check model - either with a common copybook using IF condition or CALL a sub program
}
Based on the check result, populate output file.
I thought IF might be better than CALL from performance perspective.
Thanks for the suggestion Dick. I guess I will have to go for sub program. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but the problem is for every record in input, I need to call this submodule and might b a performance issue. |
If the module is loaded only once and then repeatedly invoked, the performance will be very similar to a perform. . . |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
lanand_hps wrote: |
Easytrieve source is stored in panvalet library and is executed like EXEC PGM=PGMNAME and not in parms. |
In the Options Table you can define what kind of library is used, PDS
is one of the options.
So even if the ezt program is compiled and the macro is not in the
compiled module included, i guess it is possible to change the macro before the executable is started. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
So even if the ezt program is compiled and the macro is not in the
compiled module included, i guess it is possible to change the macro before the executable is started. |
Maybe. . . If the Easytrieve code is a linkedited module, i'm not sure that macros are resolved at run time, but rather at compile time.
Suggest this be tested - i don't have a way to test this currently |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
I've used the file as array in ezytrieve and used a binary search to do this.
Quote: |
If the module is loaded only once and then repeatedly invoked, the performance will be very similar to a perform. . . |
Can you please explain this. Sorry i didnt understand 'Loading' and 'Invoking' module. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
When a subprogram (module) is called dynamically it is loaded from dasd into memory and then control is transferred to it (modules that are called statically are part of the original load module and are not loaded when called).
Subsequent CALLs should be similar to a PERFORM and nothing should be loaded from dasd as it shjould already be in memory.
I don't understand how arrays and a binary search resolve the need to change the code "on the fly". . . |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
Thanks for the explanation Dick.
I prepared a file with list of valid models
Inside the program, I have defined this file as array.
Read input file
Search file array for the model
Write output.
is how i have modified the code. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
You're welcome
Quote: |
I prepared a file with list of valid models |
Until now, i didn't realize there was a fixed set of possibilities
Good to hear it is working,
d |
|
Back to top |
|
|
lanand_hps
New User
Joined: 05 Dec 2007 Posts: 82 Location: chennai
|
|
|
|
iF MODEL = {Set of models }
This set of models may vary daily which is a GDG file. I'm using this GDG file as array in the program. So actually I did not PREPARE a file but using this GDG file ..
Thanks again and yes it is working :-) |
|
Back to top |
|
|
|