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
 

 

How do you make your program Dynamic or static

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Wed Feb 22, 2006 5:56 am    Post subject: How do you make your program Dynamic or static
Reply with quote

How do you make your program Dynamic, and how can you make it static
Thank you

Tilte changed from "Static link and static call" to "How do you make your program Dynamic or static" : Priyesh.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Feb 22, 2006 6:39 pm    Post subject: Re: Static link and static call
Reply with quote

Dynamic Called programs use a variable in CALL Statement. You need to pass value for this variable at RUN Time... This makes a dynamic entry to the program.

Regards,

Priyesh.
Back to top
View user's profile Send private message
ranjitbhingare

New User


Joined: 30 Nov 2005
Posts: 94
Location: PUNE

PostPosted: Wed Feb 22, 2006 9:53 pm    Post subject:
Reply with quote

Hi,

To call program dynamically you specify PARM=DYNAM & for static call PARM=NODYNAM in your compile JCL in the EXEC statement.

Corrct me if I am wrong..

Regards,
Ranjit...
Back to top
View user's profile Send private message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Thu Feb 23, 2006 1:35 am    Post subject:
Reply with quote

I believe you are right thank you
Fawzy
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Thu Feb 23, 2006 10:53 am    Post subject:
Reply with quote

Call 'Program-A' is static.
Call Program-A

where
01 Program-A picx(8) valur 'Program-A' is dynamic.

DYNAM and NODYNAM specifies dyanmic and static link-options. One point to note is that a ?CALL identifier-1? format of the CALL statement is always dynamic, regardless of the compiler option used. Using this format of COBOL CALL is one way to ensure that a COBOL program?s calls are always dynamic regardless of compile time parameter settings.

[/img]
Back to top
View user's profile Send private message
fawzy47
Currently Banned

New User


Joined: 22 Oct 2005
Posts: 42

PostPosted: Fri Feb 24, 2006 1:39 am    Post subject: Re: How do you make your program Dynamic or static
Reply with quote

Static link is different from static call, I still need an a good answer, changing the title does not change the question. If you know the answer please post it, and thank you, if you don't, please don't answer and thank you for stop posting wrong answer and for your trying too.
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Fri Feb 24, 2006 9:27 am    Post subject: Re: How do you make your program Dynamic or static
Reply with quote

Well you are a very rude guy. --)
This is not supposed to be a kid's forum.

Anyway, here is the answer., what i have stated above is right.

Static and Dynamic calls

Keep in mind as you read this that some compilers let you set options that will override the calling mechanisms shown below. Therefore, even if your program is coded to call a program statically, the compiler can convert it to the dynamic form of CALL if you set (or don't set) the correct compiler options. Such compiler options are discussed at the end of this document

Static Calls

CALL 'A' USING arguments

The static form of the CALL statement specifies the name of the subroutine as a literal; e.g., it is in quotes.

This is the static form of a subroutine call. The compiler generates object code for this which will cause the linker to copy the object module a.obj into your executable when it is linked.

So, if you modify "A" and recompile it, you must also re-link all of the executables that call "A", because the each of the executables contains its own copy of "A".

Pros of static
? Entire program with all addresses resolved loaded into memory.
? Load modules are self contained and can run without elaborate search paths.

Cons of static
? Larger load modules
? Subroutines duplicated in many load modules
? Re-linking required to pick up new versions of subroutines

Dynamic

SUBROUTINE-A PIC X (8) VALUE 'A'.
.
.
CALL SUBROUTINE-A USING arguments


The dynamic form of the CALL statement specifies the name of the subroutine using a variable; the variable contains the name of the subroutine to be invoked.

The difference is that the name of the subroutine is found in the variable SUBROUTINE-A. The compiled code will cause the operating system to load the subroutine when it is required instead of incorporating it into the executable.

Pros of dynamic
? Smaller load modules
? Easier to implement maintenance to heavily called subroutines. Ie, no re-linking of mainlines when subroutines change.


Cons of dynamic
? Programs loaded at run-time, more I/O to JOBLIB
? Missing program can cause S806 (module not found)


Compiler options

You choose static/dynamic linking by choosing either the DYNAM or NODYNAM link edit option. One point to note is that a ?CALL identifier-1? format of the CALL statement is always dynamic, regardless of the compiler option used. Using this format of COBOL CALL is one way to ensure that a COBOL program?s calls are always dynamic regardless of compile time parameter settings.

With DYNAM active at compile time, CALL statements essentially become LOADs followed by a branch to the entry point address. A DYNAM compiled COBOL program will rarely encounter ?UNRESOLVED EXTERNAL REFERENCES? at link-time.

NODYNAM, as a compile-time option turns a COBOL program?s CALL statements into assembler style calls. V-Type constants are created that must be resolved by the binder/linker. NODYNAM load modules must have these external addresses statically imbedded. That is, external CSECTs must be resolved and packaged into the run-unit at link time.

A statically called subroutine will not be in its initial state the next time it is called unless you explicitly use INITIAL or you do a CANCEL. A dynamically called routine will always be in its initial state.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Feb 24, 2006 10:07 pm    Post subject: Re: How do you make your program Dynamic or static
Reply with quote

fawzy47,

I think everyone is confused as to what your question is.

There is no "LINK" statement in COBOL, so I think people think your question is in regards to STATIS vs. DYNAMIC CALLs.

There is a "LINK" staement in CICS. Is this what you mean?

Can you give an example of where a Static LINK would be used?

Please help us clear the confusion here.

Thanks,

Dave
Back to top
View user's profile Send private message
tksvv

New User


Joined: 17 Mar 2006
Posts: 6

PostPosted: Fri Mar 24, 2006 7:22 pm    Post subject: Re: How do you make your program Dynamic or static
Reply with quote

Bonniem, I liked your reply.
Back to top
View user's profile Send private message
shivani_tech
Warnings : 2

New User


Joined: 08 Jan 2006
Posts: 22
Location: UNITED KINGDOM

PostPosted: Fri Mar 24, 2006 8:32 pm    Post subject:
Reply with quote

wat happens when parm = dynam with resident and initial option kindly reply
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am


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