View previous topic :: View next topic |
Author |
Message |
Queeg Beginner
Joined: 13 Jul 2005 Posts: 4 Topics: 1
|
Posted: Wed Jul 13, 2005 5:41 am Post subject: Identifying Production/Development regions from within COBOL |
|
|
Can anyone suggest a way I can identify which environment a program is running in?
I am looking for a way to identify either the subsystem code or the IMS region name or something I can differentiate between LIVE and TEST.
Basically, I want to submit a batch job from an online program using the INTRDR. But the job it submits is dependant on whether it is either the LIVE or one of our TEST regions.
At the moment, I figure it may have to be an assembler module. If anyone has example code for either a straight COBOL solution or one involving ASM, I would be greatful.
Cheers,
-Queeg |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Queeg Beginner
Joined: 13 Jul 2005 Posts: 4 Topics: 1
|
Posted: Wed Jul 13, 2005 7:35 am Post subject: |
|
|
Unfortunately, my site is OS/VS COBOL, not COBOL II - so no POINTER usage.
Plus both our test and production systems run on the same LPAR, so this may not be what I was looking for (but without being able to run it, I can't actually tell). |
|
Back to top |
|
 |
Bithead Advanced

Joined: 03 Jan 2003 Posts: 550 Topics: 23 Location: Michigan, USA
|
Posted: Wed Jul 13, 2005 7:44 am Post subject: |
|
|
Issue an INQY call with the function of ENVIRON. This returns the IMS system ID. See the Application Programming Guide: Transaction Manager for further information. |
|
Back to top |
|
 |
Queeg Beginner
Joined: 13 Jul 2005 Posts: 4 Topics: 1
|
Posted: Wed Jul 13, 2005 7:47 am Post subject: |
|
|
Got it, thanks. |
|
Back to top |
|
 |
Queeg Beginner
Joined: 13 Jul 2005 Posts: 4 Topics: 1
|
Posted: Mon Jul 18, 2005 5:32 am Post subject: |
|
|
Actually, I'll qualify my "Got it"... I've found it in the manual, I've found I've to use the AIB area to get it and I've found IBM manuals provide no useful information whatsoever about how to code an INQY call into a COBOL program.
I've searched IBM, search GOOGLE, searched everywhere I can think of - and I'm still none the wiser.
Does anyone have any examples of using AIBTDLI in COBOL program? And can I mix AIBTDLI and CBLTDLI? |
|
Back to top |
|
 |
vikaspaniker79 Beginner

Joined: 01 Aug 2005 Posts: 12 Topics: 4 Location: India
|
Posted: Fri Aug 05, 2005 6:52 am Post subject: |
|
|
Hi,
Well if you mean to ask if you can have a AIBTDLI and CBLTDLI in the same pgm then the asnwer is 'yes'....
For the sample code u asked ....
decalare the following in working storage
Code: |
01 WD-FUNC-INQY PIC X(4) VALUE 'INQY'.
01 WD-AIB.
05 WD-AIBID PIC X(8) VALUE 'DFSAIB '.
05 WD-AIBLEN PIC 9(8) COMP VALUE 128.
05 WD-AIBSFUNC PIC X(8) VALUE 'ENVIRON '.
05 WD-AIBRSNM1 PIC X(8) VALUE 'IOPCB '.
05 FILLER PIC X(16) VALUE SPACES.
05 WD-AIBOALEN PIC 9(8) COMP VALUE 1000.
05 WD-AIBOAUSE PIC 9(8) COMP VALUE ZEROES.
05 FILLER PIC X(12) VALUE SPACES.
05 WD-AIB-RC1 PIC 9(8) COMP VALUE ZEROES.
05 WD-AIB-RC2 PIC 9(8) COMP VALUE ZEROES.
05 FILLER PIC X(4) VALUE SPACES.
05 WD-AIBRSCAD PIC 9(8) COMP VALUE ZEROES.
05 FILLER PIC X(170) VALUE SPACES.
01 WD-IOAREA.
05 WD-IMSID PIC X(4).
05 FILLER PIC X(104) VALUE SPACES.
05 WD-DEBUG-FLAG PIC X(7).
05 FILLER PIC X(885) VALUE SPACES.
In the procedure division
CALL 'AIBTDLI' USING WD-FUNC-INQY
WD-AIX
WD-IOAREA.
IF WD-AIBID = SPACES THEN
MOVE 'INQY' TO WS-IMSE-FUNCTION
MOVE '1030-GET-ENVIRO-PARM' TO WS-IMSE-PARAGRAPH
MOVE WD-AIB TO WS-IMSE-PCB
PERFORM 9999-ABEND
ELSE
MOVE WD-DEBUG-FLAG TO WF-DEBUG-FLAG
END-IF
|
Note : unsuccessfull calls have WD-AIBID as spaces.
....hope this helps ....... _________________ Cheers,
Vikas |
|
Back to top |
|
 |
|
|