View previous topic :: View next topic
|
Author |
Message |
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
HI,
can we use external variables in a series of around 5 CICS-COBOl programs in which the external variables are used only with in one program and DFHCOMMAREA is used to pass on values from one program to other via XCTL?
Thanks & Regards,
Anjum raza |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
anjumraza,
The answer is NO ( I think).
Please explain your question better. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
I was thinking about keeping the value in a TS, but then you may have to pass the TS name from one program to the other... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
I haven't found anything saying you can't use EXTERNAL variables in COBOL with CICS, but I haven't found anything saying you can, either. I suspect they are not illegal but may have unexpected side effects. Why not try a program in a test region and report back the results? If the region doesn't crash when you invoke the program with EXTERNAL variables, so much the better!
Quote: |
I was thinking about keeping the value in a TS, but then you may have to pass the TS name from one program to the other... |
That sounds like a possible COMMAREA variable to me. |
|
Back to top |
|
|
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
Hi,
The problem is i have to code around 7 to 8 programs in CICS-Cobol and there are functions like scrolling horizontal and vertical both. and i'm new to CICS. so instead of using TSQ's i used arrays(as i have to take care of horizontal scrolling so i thought arrays are better) which i declared as external along with the variables that store values for PF7's and PF8's. Till now i coded all the programs individually and tested them. all the programs worked fine but now i'm facing problem when i'm linking them. i'm calling other programs thru XCTL. For every third program when i'm reentering into it, all the external variables are getting initialized. this is happening for every third program, the behaviour is quite unpredictable.
i hope the problem is clear...
Thanks,
Anjum Raza |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
What's the commonality? Do the EXTERNAL variables initialize after an XCTL? after a CALL? after a CICS LINK? When you say "third program" does that mean the third unique program invoked, or can you see the behavior if the same program is invoked three times in a row? Can you monitor the transaction via CEDF to start figuring out the problem?
And does
Quote: |
but now i'm facing problem when i'm linking them. |
mean you're having problems with linking as well as running?
And on a side note, I just have to ask -- what is horizontal and vertical scrolling? I've seen TSQ's used to hold screens of data to allow PF7 and PF8 to go back and forth, but I don't think I've ever heard of horizontal and vertical scrolling in a CICS application. |
|
Back to top |
|
|
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
Robert,
thanks for your response. I hope below explanation will be clear,
its the third unique program.how many ever times i re enter into same program i didnot find any difficulty in the previous programs. but when i enter into third unique program first the map is displayed well but once if enter a value in the map or press any other key then the external variables are getting initialised.
i cannot use cedf as i'm working in Micro Focus but i can debug it easily thats how i came to know that the external variables are getting initialized. its not happening after an XCTL, its happening when i try to re enter into same program through a Return transid command. I dont have problem in linking its working fine, only while running the third unique program for second time i'm facing problem.
vertical scrolling refers to PF7 and PF8 and horizontal to PF10 and PF11. I preferred this terminology as after these programs are done with coding they will be migrated to windows platform where actually horizontal and vertical scrolling will occur.
Thanks,
Anjum. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hi Robert,
Kinda like the F10/11 to scroll left/right in the editor.
Most often the places i've been do this with multiple programs/panels, but some implemented actual left/right scrolliing in addition to up/down. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Since you're using Micro Focus I cannot provide any assistance -- I don't have the product nor its documentation. You may want to raise an issue with Micro Focus to get an explanation for the behavior you're seeing. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
I might sound dumb, but EXTERNAL variable addressing, whatever the programming language
are resolved at linkage editor time and only for static objects
so the whole point, from a CICS perspective is pure speculation
maybe nothing can be found in the CICS manuals,
because the issue is completely off topic
as far as CICS program management architecture is concerned |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
anjumraza,
as I indicated in an earlier post and as Enrico points out. You can't
do what you are trying to do.
Try a different approach or just ask your CICS technical support
people.
I'm curious, are you a consultant? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
FWIW, I've used EXTERNAL storage across a given run-unit successfully.
Example: A given LINK-API from program "A" to program "B" could not have its commarea altered. Instead, the new EXTERNAL variable was defined in both programs "A" and "B" and when "B" received control, this EXTERNAL variable was populated. Upon "B" returning back to "A", the EXTERNAL variable contained the data which had been populated in program "B".
The beauty here was that the commarea did not required modification.
HTH....
Regards,
Bill |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Quote: |
Instead, the new EXTERNAL variable was defined in both programs "A" and "B" |
Bill,
please explain,
how is the EXERNAL variable defined in the programs,
can you show an example?
thanks,
Earl |
|
Back to top |
|
|
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
Hi all,
Thank you all for your suggestions and comments.
though it is MF environment, it completely simulates mainframe. i didnot find any difference in coding except that there is no jcl to compile and run. can do it directly.
today while trying to resolve the issue, i found out something. Please look into it if it is of any help to me.
I declared each of the programs in PCT and PPT entries. so each program is associated with a unique transaction id. To re-enter into the same program i'm using RETURN TRANSID statement where as to jump to other program i'm using XCTL command.
As said earlier, if i'm re entering into third unique program the external variables are initialized. Today to just test the programs i tried XCTL command to return to same program instead of RETURN TRANSID command. here the external variables dint get initialized but if i press 'ENTER' only then the flow goes exactly the same way i want else if any other key like F7 is pressed which returns to same program then it is going in loop.
so My doubt is it any way related with so many transaction id's? if it is so any other method of returning to same program other than transid? |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
anjumraza,
I'm assuming your reference to defining external vairables is
a MicroFocus feature.
Have you tried contacting MicroFocus support ? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Earl,
EXTERNAL variables were introduced with COBOL2 or COBOL/370 (can't remember exactly - CRS ya know ) and must be defined at the 01 level, then all elementary items under this 01 are EXTERNAL until the next 01 is hit.
However, if the 01 level is to be used in multiple programs within a run-unit, they must be identical.
Example -
01 WS-EXTERNAL-AREA EXTERNAL.
Bill |
|
Back to top |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
Bill,
guess I'm behind the times with Cobol. Didn't know external
variable existed.
Thanks,
Earl |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Earl,
Forgot to mention "GLOBAL" variables, which are normally used in nested sub-programs, but are a different animal than "EXTERNAL" variables.
FWIW, I've not used nested sub-programs much, although they can have reduced overhead, similar to an internal PERFORM.
Bill |
|
Back to top |
|
|
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
Hi Earl and Bill,
Now even i got confirmed that the probelm i'm facing because of initializing of external variables is not a feature of microfocus.
Can you please tell me any solution to my question posted earlier.
quote:
I declared each of the programs in PCT and PPT entries. so each program is associated with a unique transaction id. To re-enter into the same program i'm using RETURN TRANSID statement where as to jump to other program i'm using XCTL command.
As said earlier, if i'm re entering into third unique program the external variables are initialized. Today to just test the programs i tried XCTL command to return to same program instead of RETURN TRANSID command. here the external variables dint get initialized but if i press 'ENTER' only then the flow goes exactly the same way i want else if any other key like F7 is pressed which returns to same program then it is going in loop.
so My doubt is it any way related with so many transaction id's? if it is so any other method of returning to same program other than transid?
Thanks,
Anjum. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Unfortunately, if each program is its own transid (IE: Run Unit), then the values populated in any EXTERNAL variable are lost upon issuing an EXEC CICS RETURN.
A Run Unit would be a series of logically "chained" programs/modules, such as invoking program/transid "A" and subsequent Called/Linked-To programs "B" through "E".
So, if you had five programs and each one of these had the same EXTERNAL variable defined, then whenever this variable is populated/updated, it is reflective in all five programs, providing the Run Unit (the CICS task/transid) isn't terminated.
However, once the Run Unit (the original invoking program/transid) issues an EXEC CICS RETURN (with or without a transid and/or commarea), the values in the EXTERNAL variables in all five programs are lost.
EXTERNAL variables are not like DFHCOMMAREA and perhaps this s where the dilemma is?
Regards,
Bill |
|
Back to top |
|
|
anjumraza
New User
Joined: 21 Nov 2007 Posts: 17 Location: bangalore
|
|
|
|
Thanks to all,
how ever I used queue's directly and modified the programs accordingly.
Once again I would like to thank all of you for wonderful suggestions.
Thanks,
Anjum.. |
|
Back to top |
|
|
|