View previous topic :: View next topic |
Author |
Message |
Premkumar Moderator
Joined: 28 Nov 2002 Posts: 77 Topics: 7 Location: Chennai, India
|
Posted: Mon Dec 02, 2002 11:06 pm Post subject: How to get the job information within the Rexx program? |
|
|
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 |
|
|
Manas Biswal Intermediate
Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Fri Dec 06, 2002 7:39 am Post subject: |
|
|
Hi,
Can I get the return code of a job submitted by my REXX program through this STORAGE function.
Regards,
Manas |
|
Back to top |
|
|
ak Beginner
Joined: 04 Dec 2002 Posts: 4 Topics: 0 Location: New York, USA
|
Posted: Fri Dec 06, 2002 11:27 am Post subject: |
|
|
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 |
|
|
miboy Beginner
Joined: 10 Jan 2003 Posts: 13 Topics: 0
|
Posted: Thu Jan 23, 2003 10:16 am Post subject: |
|
|
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 |
|
|
Premkumar Moderator
Joined: 28 Nov 2002 Posts: 77 Topics: 7 Location: Chennai, India
|
Posted: Thu Jan 23, 2003 11:40 pm Post subject: |
|
|
Check the manuals on MVS Data Areas (5 Volumes!) in OS/390 V2R10.0 MVS bookshelf.
PSA is the starting point. |
|
Back to top |
|
|
syandra Beginner
Joined: 26 May 2003 Posts: 19 Topics: 6
|
Posted: Tue May 27, 2003 8:57 am Post subject: |
|
|
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 |
|
|
yanko Beginner
Joined: 05 Jun 2003 Posts: 1 Topics: 0
|
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Wed Jun 11, 2003 12:56 pm Post subject: |
|
|
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 |
|
|
|
|