Page 1 of 1

What sort of call do you use?

PostPosted: Fri Mar 04, 2011 3:38 am
by BillyBoyo
No rush to answer this, just for my own thoughts.

Call "literal" I get. I can scan the souce for every program that uses a particular sub-program. If a static call, I can autolink it (I assume that is still around). If a dynamic call, I can eve see all the modules a program calls by browsing the object or load module. You can even make a little hybrid of static/dynamic (or the technies can).

I may be too "old school", but call data-name of any sort, I don't get. Not for production. Are there any reasons to use it over an ordinary call "literal"?

Re: What sort of call do you use?

PostPosted: Fri Mar 04, 2011 3:52 am
by dick scherrer
Hello,

Once upon a time (if my memory is still connected), this was a way to force a dynamic call rather than a static call.

A couple of places i've been took this a bit further and provided module names at run-time. Some were in a PARM, others in a "control lib" member. One such was a series of programs that called a "heuristic model" sub-program and depending on which model was to be processed, different code was called.

Re: What sort of call do you use?

PostPosted: Fri Mar 04, 2011 4:07 am
by BillyBoyo
Thanks Dick. So for a specific purpose, and one where it would reduce the flexibilty/understandability to stick to call "literal". OK, I'll buy that one.

Re: What sort of call do you use?

PostPosted: Fri Mar 04, 2011 1:36 pm
by Zio69
The client I'm currently working for only uses CALL variable. That's partly an "heritage" of an 80s software they bought in the US for their core business . That package only used CALLS like "CALL general-copy-program" or "CALL bubble-sort"; those variables were in a huge copybook, included in every single program. This way not only they made every call dynamic (which can be good, so when you modify "bubble-sort" you don't have to recompile everything...) but also gave more understandable form to the call (bubble-sort is more meaningful than XYZ). I guess they liked that, because now it's in their policy to use CALL variable.
The previous client had also a strict policy about calls: only use variables named after the program you're calling. So to call HIDUDE, one had to code a variable named HIDUDE value 'HIDUDE'.

Personally, I had once a reason to call different programs from the same CALL statement. A few years ago I had to improve the efficiency of a set of programs; they all used a simple sort algorithm that was quite inefficient (to say the least). So I replaced that with a recursive quick-sort (yep, now you can do recursive programs in cobol). The only problem was that with large arrays of data the recursive program needed a huge amount of memory.... sometimes even more than the maximum region we were allowed to use (96M). Which led me to write an ASM bubble-sort program that received the same input area; the main program decided which program to call depending of the numbers of items in the array. Since hindsight is 20/20 I now know I should have gone for a shell algorithm...... maybe next time!

Re: What sort of call do you use?

PostPosted: Fri Mar 04, 2011 2:17 pm
by stevexff
It's been said that a sysprog can answer any technical question with one of two answers. The first is "there is a bit set somewhere" and the second is "it depends...". I'm going to opt for the latter here :)

Modular design encourages you to break programs up into subprograms. If you have a large system then it makes sense to have programs that are called by almost every other module (error loggers, reference data lookups, for example) linked as seperate load modules and called dynamically. There is a small overhead involved, but nothing too bad provided they are compiled as subprograms and don't cause LE/370 to make a new enclave when they are called.

This protects you from having to re-link every module in your system if you make a change to a common component. The downside to this is it makes an impact analysis harder to do (with static calls you can either use your source control system to produce a report, or even run an AMBLIST on your load library and post-process it to produce a cross-reference. I tend not to scan the source as the AMBLIST is more reliable unless you have CHANGE statements in your link edits, which is unusual).

We have thousands of programs in our system, and we use a mixture of both as appropriate.

Re: What sort of call do you use?

PostPosted: Sat Mar 05, 2011 4:07 am
by BillyBoyo
Thanks Zio69. I like "self-documenting" programs (data-names, labels) but never thought about data-names for programs. I don't know why I didn't think of "beacuse that's what the standard says" either.

Thanks Steve. I know about that bit, I set it once (an UPSI), which told the linkedit that it had a 3330 disk to write to (I didn't know it was doing this, I set the switch for another purpose) but it wasn't, so I overwrote the VTOC entry on a 3350. Which had all the libraries on. Everytime the system tried to load any program (online, batch, operating system) up would come "Unable to load program" and 2/3 of my program name on the OPS console. They tried a restore followed by a warm start (no luck), a cold start (no luck) and in the end they had to go to the weekly image back-up (fortunately, taken early that Saturday morning, so bye-bye all my work, and that of the 200 data-entry girls doing Christmas-backlog overtime).

Yes, I've had to do too many link-edits in the past, just to pick up the current version of a common module. A dynamic call would have been a nice way around it. Didn't get there until using Easytrieve Plus at a site whose "standard" was static calls. Easytrieve Plus doesn't do static. Management wasn't keen, but had to bend. I later found that the databse group, using SUPRA, had been doing dynamic calls for years, and just didn't know that they should have told someone.

I'm still not sure I like call data-name. If I compile for a dynamic call, it is quite nice, because if I browse the object module I can see a list of all the modules (and cobol routines) that the program uses. If I do a call data-name, I won't see that in the list (I can't, because it could be resolved at run-time).

I guess here it is accentuating a problem which at least used to exist with dynamic calls. How can you be certain that all the modules which are called are in your STEPLIB datasets? If you are doing static calls, the likage-editor helps you out (unresolved). If it is dynamic, a production S806 can be very annoying.

Re: What sort of call do you use?

PostPosted: Sat Mar 05, 2011 4:23 am
by dick scherrer
Hello,

If it is dynamic, a production S806 can be very annoying.
Annoying for sure.

However, if this happens, it says there are no proper standards or they are not being followed. . .

I have this vision of some evil/mad scientist-type developer saying "Heh, heh, heh - now where can i hide this one. . .".

Re: What sort of call do you use?

PostPosted: Sat Mar 05, 2011 5:11 am
by BillyBoyo
dick scherrer wrote:
However, if this happens, it says there are no proper standards or they are not being followed. . .



Absolutely right, and unfortunately it was the former. At the heart of that problem, the company was a bit "cheap". In development, we had no spare time or people, in production control, the same. Production releases (the final load modules and the JCL) got no testing. None. Zilch. The JCL was "not so bad", as mostly, if there was a problem, it would fail immediately. On the bigger systems (I worked on the smaller ones, only 50-200 cobol modules per load module) you could be four hours into a production run and, S806.

Now, this would come about due to an error in the release procedure (release forms were usually only filled-in at the last minute, and someone might miss off a module in haste, and sometimes Frank had hundreds of modules to promote, and would miss one (or two).

No money for more people for production testing. Release process entirely manual, and just treated as the last thing you do to get something live.

At least what we didn't do, was loose sources...

I'll give you another example of how cheap they were. When we moved to MVS, we used ISPF. What could we do on option 7? Run UCC1. Nothing else. Why? "TSO takes up too many resources for developers to use".

dick scherrer wrote:I have this vision of some evil/mad scientist-type developer saying "Heh, heh, heh - now where can i hide this one. . .".


Now, later, in financial environments, this is exactly what all the auditors wanted to know we couldn't be doing. I know they wouldn't have liked "call data-name". They'd ask me, "how can you show me that this is the program that is being used"? With call data-name, I'm not sure I could.

Re: What sort of call do you use?

PostPosted: Mon Mar 07, 2011 2:58 pm
by Zio69
BillyBoyo wrote:Now, later, in financial environments, this is exactly what all the auditors wanted to know we couldn't be doing. I know they wouldn't have liked "call data-name". They'd ask me, "how can you show me that this is the program that is being used"? With call data-name, I'm not sure I could.

The guys I'm working for use a tool called XINFO (http://www.mainsoft.fi/Default.aspx?ID=54). For CALLS it produces a report like this:
--------------------- COBOL - CALL ---------------------- ROW 001 TO 010 OF 010
Command ===>                                                  SCROLL ===> PAGE
                                                                               
Top   : Legend  SAVE  SORT  Find  STAT  LIBS  BATCH  Arrange  EXit             
        ALL  FIX  SHOW  EditSQL  Info  Tables  Group  REFresh                 
Bottom: ? List all Line Commands S Select  PJ PGM/PROC  DS Dataset             
        2D SELECT/ASSIGN  2G COBOL/General  2I COPY  2S CICS  2T FileSection   
        2U FileUsage  2Y Called  22 COBOL/DB2  BM Browse/Main ...             
                                                                               
   MainPgm  SrcMemb   Line D Calling Proc      CalledNm Called Proc SymName (Va
__ GE816BCE GE816BCE   363 N INIZIO            GE111SCE GE111SCE               
__ GE816BCE GE816BCE   365 N INIZIO            GE000SCE GE000SCE               
__ GE816BCE GE816BCE   460 N 0020-IMPOSTA-DATI GE083SCE GE083SCE               
__ GE816BCE GE816BCE   465 N 0020-IMPOSTA-DATI GE000SCE GE000SCE               
__ GE816BCE GE816BCE   472 N 0020-IMPOSTA-DATI GE009SCE GE009SCE               
__ GE816BCE GE816BCE   477 N 0020-IMPOSTA-DATI GE000SCE GE000SCE               
__ GE816BCE GE816BCE   485 N 0020-IMPOSTA-DATI GE025SCE GE025SCE               
__ GE816BCE GE816BCE   488 N 0020-IMPOSTA-DATI GE000SCE GE000SCE               
__ GE816BCE GE816BCE   866 N 9999-ERRORE-VSAM  GE000SCE GE000SCE               
__ GE816BCE Y2KPACCD     2 N                   Y2KACCDT Y2KACCDT               

.... would that satisfy those inspectors? (I guess they would be terrified by all the NOPped labels I put in ASM programs.... :D )

Re: What sort of call do you use?

PostPosted: Mon Mar 07, 2011 4:07 pm
by BillyBoyo
What does it do with call data-name? They were'nt stupid, and knew what a data-name was. I can just see Nigel raising his eyebrows and saying a short "oh". Then we'd look forward to a memo.

By the way, the quote was from me, not from Dick (I was firstly quoting Dick).
Corrected in the previous reply