IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

procedure copybook in easytrieve


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Aug 26, 2010 3:17 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Aug 26, 2010 3:23 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 26, 2010 9:55 am
Reply with quote

You could define a MACRO.
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Aug 26, 2010 10:30 pm
Reply with quote

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
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Thu Aug 26, 2010 11:14 pm
Reply with quote

Easytrieve source is stored in panvalet library and is executed like EXEC PGM=PGMNAME and not in parms.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Aug 26, 2010 11:48 pm
Reply with quote

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
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Aug 27, 2010 12:52 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 27, 2010 3:03 am
Reply with quote

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
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Aug 27, 2010 10:58 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 27, 2010 7:07 pm
Reply with quote

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 icon_sad.gif
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Aug 27, 2010 8:44 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 27, 2010 8:55 pm
Reply with quote

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". . . icon_confused.gif
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Aug 27, 2010 9:11 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 27, 2010 9:26 pm
Reply with quote

You're welcome icon_smile.gif

Quote:
I prepared a file with list of valid models
Until now, i didn't realize there was a fixed set of possibilities icon_smile.gif

Good to hear it is working,

d
Back to top
View user's profile Send private message
lanand_hps

New User


Joined: 05 Dec 2007
Posts: 82
Location: chennai

PostPosted: Fri Aug 27, 2010 10:51 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Excuting store procedure via JCL batch JCL & VSAM 1
No new posts Executing DB2 SQL store procedure via... DB2 0
No new posts Overwriting SSN Digits in Easytrieve ... CA Products 0
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top