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 

How to get the job information within the Rexx program?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Premkumar
Moderator


Joined: 28 Nov 2002
Posts: 77
Topics: 7
Location: Chennai, India

PostPosted: Mon Dec 02, 2002 11:06 pm    Post subject: How to get the job information within the Rexx program? Reply with quote

Use STORAGE function to pass through Data Areas and get the required info.

Code:

/* Rexx */                             
 TCB      = PTR(540)                   
 TIOT     = PTR(TCB+12)                 
   JNAM   = STG(TIOT,8)                 
   SNAM   = STG(TIOT+8,8)               
   PSNAM  = STG(TIOT+16,8)               
 JSCB     = PTR(TCB+180)               
   PNAM   = STG(JSCB+360,8)             
 SSIB     = PTR(JSCB+316)               
   JNUM   = STG(SSIB+12,8)             
 Say 'JOB NAME      :' JNAM             
 Say 'PROC STEP NAME:' PSNAM             
 Say 'STEP NAME     :' SNAM             
 Say 'PROGRAM NAME  :' PNAM             
 Say 'JOB NUMBER    :' JNUM             
 Exit(0)                               
 PTR: Return C2D(STORAGE(D2X(ARG(1)),4))
 STG: Return STORAGE(D2X(ARG(1)),ARG(2))
   
Back to top
View user's profile Send private message Send e-mail
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Fri Dec 06, 2002 7:39 am    Post subject: Reply with quote

Hi,

Can I get the return code of a job submitted by my REXX program through this STORAGE function.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
ak
Beginner


Joined: 04 Dec 2002
Posts: 4
Topics: 0
Location: New York, USA

PostPosted: Fri Dec 06, 2002 11:27 am    Post subject: Reply with quote

Manas, You can. Though I am not great fan of it, I usually think without that 'something else can be designed to do to trap previous RC'. One thing is to determine the RC in Rexx after submitting by polling the TSO STATUS in the same EXEC that submits. If this problem is closely looked at that can be automated in CA7 (and alike products) with COND CODE check. Regardless of the rant, here is what you wanted and the credit goes to Vijay Gordhanbhai.

Code:

/* REXX */                                                             
NUMERIC DIGITS(32) /* ENSURE MAX PRECISION */                           
      TCB=STORAGE(D2X(540),4)                   /* PSATOLD  IN PSA */   
      JSCB =STORAGE(D2X(C2D(TCB)+180),4)        /* TCBJSCB IN TCB   */ 
      JCT  = STORAGE(D2X(C2D(JSCB)+261),3)      /* JSCBJCTA IN JSCB */ 
      THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))           
                                                /* THIS STEP NO.    */ 
      FSCT = STORAGE(D2X(C2D(JCT)+48),3)        /* JCTSDKAD IN JCT  */ 
                                                /* IS FIRST SCT     */ 
      TEMP_SCT = FSCT                                                   
      DO I = 1 TO (THIS_STEP_NO - 1)                                   
         STEP   = STORAGE(D2X(C2D(TEMP_SCT)+68),8)                     
         RCSTEP = X2D(C2X(STORAGE(D2X(C2D(TEMP_SCT)+24),2)))           
                                                /* SCTSEXEC IN SCT  */ 
         BYPASS = STORAGE(D2X(C2D(TEMP_SCT)+188),1)                     
         IF X2D(C2X(BYPASS)) = 80 THEN          /* CHECK IF STEP WAS*/ 
                                                /* NOT EXECUTED     */ 
            RCSTEP = 'FLUSHED '                                         
         SAY 'STEP ==>' STEP '  RC ==>' RCSTEP                         
         TEMP_SCT = STORAGE(D2X(C2D(TEMP_SCT)+36),3)                   
      END                                                               
 EXIT                                                                   
Back to top
View user's profile Send private message
miboy
Beginner


Joined: 10 Jan 2003
Posts: 13
Topics: 0

PostPosted: Thu Jan 23, 2003 10:16 am    Post subject: Reply with quote

PREMKUMAR,

Is there a manual that would says the different item present in the data area

Like how did u know that 540 was the loc of TCB

Thanks,
MIboy
Back to top
View user's profile Send private message
Premkumar
Moderator


Joined: 28 Nov 2002
Posts: 77
Topics: 7
Location: Chennai, India

PostPosted: Thu Jan 23, 2003 11:40 pm    Post subject: Reply with quote

Check the manuals on MVS Data Areas (5 Volumes!) in OS/390 V2R10.0 MVS bookshelf.
PSA is the starting point.
Back to top
View user's profile Send private message Send e-mail
syandra
Beginner


Joined: 26 May 2003
Posts: 19
Topics: 6

PostPosted: Tue May 27, 2003 8:57 am    Post subject: Reply with quote

HI PremKumar,

Can u suggest me few good books on mainframes instead of those online manuals. I am a beginner and I am not comfortable with them.

Thanks,
Sukumar
Back to top
View user's profile Send private message
yanko
Beginner


Joined: 05 Jun 2003
Posts: 1
Topics: 0

PostPosted: Thu Jun 05, 2003 7:57 am    Post subject: Reply with quote


hello,

you can get some good mvs books of doug lowe, to
understand better the mvs.

ref. amazon below;

http://www.amazon.com/exec/obidos/ASIN/0911625569/qid=1054817012/sr=2-1/ref=sr_2_1/102-3448212-1089739
Back to top
View user's profile Send private message
Anand_R
Intermediate


Joined: 24 Dec 2002
Posts: 189
Topics: 60

PostPosted: Wed Jun 11, 2003 12:56 pm    Post subject: Reply with quote

Hi ak,

the solution u provided to capture the return code would be implemted after the job is ended or during the job execution??

Thanks
Anand
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF 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