Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to read Date and Time of Job submission? 2

Status
Not open for further replies.

balsu79

Programmer
Jun 9, 2007
2
0
0
US
I am using the following code to get Job name and Job number, for one of my tool I need to capture the Date and Time at which the job started execution. Please tell me how to get that information.

/* 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))
 
Try this.
I found the SWAREQ routine on the internet.
I haven't fully tested it, but it worked on my system.

/* 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)
JSCB= PTR(TCB+180)
sva = STORAGE(D2X(JSCB+261),3)
JCT = SWAREQ(sva)
JTime=C2D(STG(JCT+146,3))
sva = STORAGE(D2X(JCT+36),3)
JCTX= SWAREQ(sva)
JDate=C2X(STG(JCTX+92,4))
Jdate = Date('U',substr(Jdate,3,5),'J')
Tth=Jtime//100
Thh=(JTime%100)%3600
Tmm=(JTime%100-(Thh*3600))%60
Tss=(JTime%100-(Thh*3600)-(Tmm*60))
Jtime=right(Thh,2,0)':'right(Tmm,2,0)':'right(Tss,2,0)'.'Tth
SAY 'JOB NAME:' JNAM
SAY 'PROC STEP NAME:' PSNAM
SAY 'STEP NAME :' SNAM
SAY 'PROGRAM NAME:' PNAM
SAY 'JOB NUMBER:' JNUM
SAY 'JOB Date:' JDate
SAY 'JOB Time:' JTime
EXIT 0
PTR: RETURN C2D(STORAGE(D2X(ARG(1)),4))
STG: RETURN STORAGE(D2X(ARG(1)),ARG(2))
/* SWAREQ routine written by Gilbert Saint-flour */
SWAREQ:
IF RIGHT(C2X(ARG(1)),1) <> 'F' THEN /* SWA=BELOW ? */
RETURN C2D(ARG(1))+16 /* yes, return sva+16 */
NUMERIC DIGITS 10 /* allow up to 7FFFFFFF */
sva=C2D(ARG(1)) /* convert to decimal */
tcb = C2D(STORAGE(21C,4)) /* TCB PSATOLD */
jscb = C2D(STORAGE(D2X(tcb+180),4)) /* JSCB TCBJSCB */
qmpl = C2D(STORAGE(D2X(jscb+244),4)) /* QMPL JSCBQMPI */
qmat = C2D(STORAGE(D2X(qmpl+24),4)) /* QMAT QMADD */
DO WHILE sva>65536
qmat = C2D(STORAGE(D2X(qmat+12),4)) /* next QMAT QMAT+12 */
sva=sva-65536 /* 010006F -> 000006F */
END
RETURN C2D(STORAGE(D2X(qmat+sva+1),4))+16
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top