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
 

 

procedure copybook in easytrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: procedure copybook in easytrieve
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

Site Director


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

PostPosted: Thu Aug 26, 2010 3:23 am    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 26, 2010 9:55 am    Post subject:
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    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Aug 26, 2010 11:48 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Aug 27, 2010 3:03 am    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Aug 27, 2010 10:58 am    Post subject:
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

Site Director


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

PostPosted: Fri Aug 27, 2010 7:07 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Aug 27, 2010 8:55 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Fri Aug 27, 2010 9:26 pm    Post subject: Reply to: procedure copybook in easytrieve
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Copybook structure in Load module Vai123 COBOL Programming 7 Fri Sep 16, 2016 8:29 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
No new posts Is possible to call subprogram from c... cmsmoon COBOL Programming 3 Fri Aug 05, 2016 6:46 pm


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