MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Identifying Production/Development regions from within COBOL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
Queeg
Beginner


Joined: 13 Jul 2005
Posts: 4
Topics: 1

PostPosted: Wed Jul 13, 2005 5:41 am    Post subject: Identifying Production/Development regions from within COBOL Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jul 13, 2005 6:26 am    Post subject: Reply with quote

Queeg,

Check this link which discusses about returning the system id on which the pgm is running

http://mvsforums.com/helpboards/viewtopic.php?t=536&highlight=system

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Queeg
Beginner


Joined: 13 Jul 2005
Posts: 4
Topics: 1

PostPosted: Wed Jul 13, 2005 7:35 am    Post subject: Reply with quote

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
View user's profile Send private message
Bithead
Advanced


Joined: 03 Jan 2003
Posts: 550
Topics: 23
Location: Michigan, USA

PostPosted: Wed Jul 13, 2005 7:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Queeg
Beginner


Joined: 13 Jul 2005
Posts: 4
Topics: 1

PostPosted: Wed Jul 13, 2005 7:47 am    Post subject: Reply with quote

Got it, thanks.
Back to top
View user's profile Send private message
Queeg
Beginner


Joined: 13 Jul 2005
Posts: 4
Topics: 1

PostPosted: Mon Jul 18, 2005 5:32 am    Post subject: Reply with quote

Actually, I'll qualify my "Got it"... I've found it in the manual, Confused I've found I've to use the AIB area to get it Neutral and I've found IBM manuals provide no useful information whatsoever about how to code an INQY call into a COBOL program. Embarassed

I've searched IBM, search GOOGLE, searched everywhere I can think of - and I'm still none the wiser. Sad

Does anyone have any examples of using AIBTDLI in COBOL program? And can I mix AIBTDLI and CBLTDLI?
Back to top
View user's profile Send private message
vikaspaniker79
Beginner


Joined: 01 Aug 2005
Posts: 12
Topics: 4
Location: India

PostPosted: Fri Aug 05, 2005 6:52 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group