Use GDA in Functions

Hi,

is it possible to use GDAs in functions?

Best regards,
Markus Wessjohann

Hi Markus;

I have been unable to find any comment in the documentation that says this is permitted or denied.

I have tried to “check” functions with varied positionality for a GDA; no luck.

All that said, it would seem counter intuitive to permit this. Every user of the function would have to have the same GDA and use the same variable names; an administrative nightmare.

steve

Hi,

I wouldn’t work that out, so I asked, maybe I did something wrong.

What I wanted is, that I what to “hide” the GDA behind functions. No natural modul get direct access to the GDA. All moduls have to use a function to set or get a GDA-Variable.

I can use a subprogram, but I thought functions are easier to use.

Best regards,
Markus Wessjohann

Hi Markus,

Sounds more like you want to set AIV values, not use a GDA. I don’t see why you couldn’t use functions or subprograms to set AIVs. Keep in mind AIV values get reset when you issue a LOGON command, so you’ll want some LOGONEX1 to run any time someone changes libraries to re-assign AIV values if you decide to go that way.

-Brian

Hi,

I want to hide the GDAs/AIV. This gives my more controll, whitch programs get access to them.
I can addional security option to the GDA/AIV-Access-programs. Can program ABC modify GDA value XYZ, can program DEF modify GDA value WVX? Log all changes in one place etc.

If all programs uses only the GDA/AIV-Access-programs it is no problem to add a new GDA variable. I only have to cat all Access-programs.

AIV are reseted on LOGON is ok, GDAs as well :wink:

AIV with functions is a good point, I’ll think abut this.

What I really want is to use no GDAs/AIV at all, but if thats doesn’t work, I want to get more controll of it.

Best regards,

Markus Wessjohann

Another idea is to store these values in an Adabas file, and you can control and secure access to them through modules hidden in a protected steplib. You could build functions or subprograms that retrieve and set these values and even preserve them across LOGONs.

Just thinking out loud…

Hi,

I want an easy and a fast way to controll the GDA-variables. If I use a Adabase file I have to think about to how to capsulate the different natural-sessions.
Example:

User A is working on Police 1234 and User B on Police 3456. User B as another session with Police 7890. So I will have to different the users and the sessions.
Another point is, that all the DB-traffic will be very high. There are many moduls that get access to the GDA.
I think that isn’t an option.

I wanted to use function, to have an easy way:

SET-POLICE( <12345> )

IF IS-POLICE-STATUS( )

  • Do work
    END-IF

With Subprograms will it look like:

RESET GDA-PDA
GDA-PDA.GDAFIELD(1) := ‘POLICE’
GDA-PDA.POLICE := 12345
CALLNAT ‘SETGDA’ GDA-PDA

RESET GDA-PDA
CALLNAT ‘GETGDA’ GDA-PDA

IF GDA-PDA.POLICE-STATUS EQ C-OPEN

  • Do work
    END-IF

Another problem is that I the PDA musst look like GDA and when I am changing the GDA I musst change the PDA => CAT ALL.

If GDAs doesn’t work with function I will try something else.

Best regards,

Markus Wessjohann