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
 

 

What is Mainframes Stub programs(with example )

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

New User


Joined: 08 Jan 2007
Posts: 4
Location: Mumbai

PostPosted: Thu Jan 11, 2007 11:18 pm    Post subject: What is Mainframes Stub programs(with example )
Reply with quote

Hi All,

I want to know What is a stub program?

Do we have a stub program in Mainframes? If it exists.....then please give me an example and tell me how to submit the stub programs.

Becuase we have a list of stub programs in production.
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 Jan 12, 2007 5:48 am    Post subject:
Reply with quote

Hello,

At many sites, stub programs are "placeholders". They can complete a sequence without doing anything.

Let's say you have an application that the design calls for many common subroutines. Let's also say that what kind of data goes into and is to be returned from a particular subroutine is also known.

If some modules are unable to test because this subroutine has not yet been completely spec'ed and written, you could create a stub that is callable but merely returns a literal.

In another case, let's say you've written a callable routine but none of the modules that will call your routine are written yet. You could write your own test program to call the soubroutine. This way you could test your callable module with your own testing stub.

Another use for stub code is to display CICS maps when the actual transaction code is not coded. This is an easy way to show others what the screens and their help panels look like.
Back to top
View user's profile Send private message
mahic

New User


Joined: 08 Jan 2007
Posts: 4
Location: Mumbai

PostPosted: Sat Jan 13, 2007 6:25 pm    Post subject: How to RUN/EXECUTE/INITIATE a STUB?
Reply with quote

can u plz tell me how to start a stub.
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: Sat Jan 13, 2007 10:37 pm    Post subject:
Reply with quote

Hello,

A stub is like any other COBOL program.

Take some small module from your library, copy it to a new name like STUPSAMP.

Remove all of the SELECT statements.

Remove all of the DATA DIVISION except for the WORKING-STORAGE statement and an "eye-catcher" (i.e. 'STUBSAMP BEGINS HERE').

Remove all of the procedure division code except a GOBACK statement.

Save STUBSAMP with the changes just made and you have your first stub program. Once you determine where you need a stub, copy STUBSAMP to another name according to your site's naming convention and put in the code appropriate to what you want the stub to do - keeping in mind that it may call something or be called by something. The actual executable code is completely depends on your requirement so you will need to write your code accordingly.

One example that comes to mind is that you've written a generic date handling routine for the entire application/site to use and to test it you might write a stub that calls your date routine with valid and invalid data to ensure that your date routine works properly.
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 Are there any Freeware utilties for i... johnmull IBM Tools 2 Wed Dec 21, 2016 8:29 am
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts User exit in COBOL programs ganasrinivasan PL/I & Assembler 0 Thu Aug 18, 2016 12:48 pm
No new posts "DFSRRC00 vs IKJEFT01" for ... arunsoods All Other Mainframe Topics 5 Fri Aug 12, 2016 9:54 pm


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