IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How can I get jobid of a submitted job in a test file?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Aug 08, 2011 6:30 pm
Reply with quote

How can I get jobid of a submitted job in a test file? Is there any way to do that?
Back to top
View user's profile Send private message
Soumik Das

New User


Joined: 06 Aug 2011
Posts: 25
Location: India

PostPosted: Mon Aug 08, 2011 6:48 pm
Reply with quote

I guess you should give us a little more detail.

Have you already submitted the job and want to pickup its details in a test file or are you trying to submit a job and simultaneosuly trying to put the job id in the test file?
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Aug 08, 2011 6:57 pm
Reply with quote

Soumik Das wrote:
I guess you should give us a little more detail.

Have you already submitted the job and want to pickup its details in a test file or are you trying to submit a job and simultaneosuly trying to put the job id in the test file?



I am trying to submit a job and simultaneosuly trying to put the job id in the test file?

I would also like to know the way of getting already submitted job's details(if there is any way)
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Mon Aug 08, 2011 7:00 pm
Reply with quote

Pankaj,

How about some spool programming?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 08, 2011 7:07 pm
Reply with quote

Companions to the TSO SUBMIT command are the STATUS and OUTPUT commands. Maybe one, or both of those, will suit your needs?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 7:11 pm
Reply with quote

Why a "test file" rather than a "file"?

What about pen-and-old-listing and just write it down?

Copy/paste from your emulator?

You're not, perhaps, considering writing "A Tool" are you? Search the TSO/rexx forum for a fairly recent discussion that could help you if you are.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 7:38 pm
Reply with quote

Hello,

The easiest way (that i know of) to do what you want while the job is running is to "chase control blocks". There are multiple prior topics about this (search for things like "control blocks", "data areas", jfcb) or try this link that has some sample code:
gsf-soft.com/Freeware/COB2JOB.shtml
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Aug 08, 2011 7:49 pm
Reply with quote

dick scherrer wrote:
Hello,

The easiest way (that i know of) to do what you want while the job is running is to "chase control blocks". There are multiple prior topics about this (search for things like "control blocks", "data areas", jfcb) or try this link that has some sample code:
gsf-soft.com/Freeware/COB2JOB.shtml


Can you please explain "chase control blocks".
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 08, 2011 8:07 pm
Reply with quote

Don't pay attention to me, I just want to watch this topic... icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Aug 08, 2011 8:49 pm
Reply with quote

A REXX version of D's job.
billlalonde.tripod.com/rexx/findjsab.txt
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Aug 08, 2011 9:06 pm
Reply with quote

ppandey07,

Code the following DFSORT Step at the end of your job and it will print the jobname

Code:

//STEP0100 EXEC PGM=SORT,PARM='JP1"&JOBNAME"'         
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,HEADER1=('THE JOBNAME IS : ',JP1)   
//*
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Mon Aug 08, 2011 9:19 pm
Reply with quote

Skolusu wrote:
ppandey07,

Code the following DFSORT Step at the end of your job and it will print the jobname

Code:

//STEP0100 EXEC PGM=SORT,PARM='JP1"&JOBNAME"'         
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,HEADER1=('THE JOBNAME IS : ',JP1)   
//*



Thanks for your suggestions. However I need JOBID not JOBNAME in my file. Please advise if that could be done via DFSORT
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 9:31 pm
Reply with quote

ppandey07 wrote:
Skolusu wrote:
ppandey07,

Code the following DFSORT Step at the end of your job and it will print the jobname

Code:

//STEP0100 EXEC PGM=SORT,PARM='JP1"&JOBNAME"'         
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                       
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                       
  SORT FIELDS=COPY                                   
  OUTFIL REMOVECC,HEADER1=('THE JOBNAME IS : ',JP1)   
//*



Thanks for your suggestions. However I need JOBID not JOBNAME in my file. Please advise if that could be done via DFSORT


Pankaj,

Why don't you go to a DFSORT manual, links abound, look up what Kolusu has already done, and see if there is anything in the environs which suits your...

still unknown requirement!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 08, 2011 9:47 pm
Reply with quote

Hello,

Quote:
Can you please explain "chase control blocks".
The connection between various control blocks (or data areas) is the heart of the operating system. These can be navigated by code. The GSF link i posted shows a bit of this code - which would provide the result i thought you want.

I may have been mistaken. . . I understood that you wanted job name however, you later say:
Quote:
I need JOBID not JOBNAME in my file.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 09, 2011 12:06 am
Reply with quote

You can CALL this sub-program from a Main Caller, passing a 16-Byte parmarea. It will return the Job-Name and Job-Nbr (Job-Id) as two 8-byte fields -

Code:

*PROCESS RENT                      PROGRAM IS RE-ENTRANT
         PRINT GEN                 ACTIVATE MACRO EXPANSION
PRMDSECT DSECT                     PARMAREA (R7)
         USING *,R7                INFORM ASSEMBLER
PRMJOBNM DS    CL8                 PARM-JOBNM (XXXXXXXX)
PRMJOBID DS    CL8                 PARM-JOBID (FMT=JOB00000)
STGDSECT DSECT                     DYNAMIC-STG (R9)
         USING *,R9                INFORM ASSEMBLER
STGAREA  DS    0XL80               BEGIN STG-AREA
DWORD    DS    D                   DOUBLEWORD-WORKAREA
REGSAVEA DS    XL72                REGISTER-SAVEAREA
GETJINFO CSECT                     CSECT-BASE (R3)
         USING *,R3                INFORM ASSEMBLER
         SAVE (14,12)              SAVE REGISTERS
         LA    R3,0(,R15)          CSECT-ADDRESSABILITY
         L     R7,0(,R1)           PARMAREA-ADDRESSABILITY
         LA    R0,L'STGAREA        DYNAMIC-STG LGTH
         STORAGE OBTAIN,LENGTH=(R0),ADDR=(R1),COND=YES
         LTR   R15,R15             GOOD RETURN-CODE?
         BNZ   RTN2CLLR            NO, RETURN TO CALLER
         LR    R9,R1               DYNAMIC-STG BASE-REGISTER
         XC    STGAREA,STGAREA     ENSURE X'00'S
         LA    R15,REGSAVEA        POINT TO OUR 'RSA'
         ST    R13,4(,R15)         BACKWORD-CHAIN
         ST    R15,8(,R13)         FORWARD-CHAIN
         LR    R13,R15             POINT TO OUR 'RSA'
         LA    R10,DWORD           POINT TO 1ST-WORD
         EXTRACT (R10),'S',FIELDS=TIOT
         L     R10,DWORD           GET ADDRESSABILITY
         MVC   PRMJOBNM,0(R10)     POPULATE 'JOBNAME'
         L     R10,540             CURRENT 'TCB'
         L     R10,180(,R10)       POINT TO 'JFCB'
         L     R10,316(,R10)       POINT TO 'SSID'
         LA    R10,12(,R10)        OK, WE'RE HERE
         MVC   PRMJOBID,0(R10)     POPULATE AS C'JOB00000'
         L     R13,4(,R13)         RESTORE CALLER'S R13
         LA    R0,L'STGAREA        DYNAMIC-STG LGTH
         LR    R1,R9               LOAD STG-ADDRESS
         STORAGE RELEASE,LENGTH=(R0),ADDR=(R1),COND=NO
         XR    R15,R15             ENSURE X'00'S
RTN2CLLR EQU   *
         RETURN (14,12),RC=(15)    RETURN TO CALLER
         LTORG ,
GETJINFO AMODE 31
GETJINFO RMODE ANY
         YREGS ,                   REGISTER-EQUATE MACRO
         END   ,                   END 'GETJINFO'

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 1:59 am
Reply with quote

danke bill, aber SORT klingt ein bisschen einfacher

oder

danke bill, aber mit SORT ein bisschen einfacher klingt
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 09, 2011 2:33 am
Reply with quote

Dick,

icon_question.gif icon_question.gif icon_question.gif

Was this overkill?

I know it works....

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 3:04 am
Reply with quote

no, it works. provides the same info as Saint-Flour's cob2job.
and since it is assembler, probably faster than cobol.

problem is, getting it compiled in sites which rigidly control what programming languages are used.

I was tired and wanted to say something about the sort solution.

what gets me is that I have never worked at a site - 20 some,
that needed to have a special routine within a job to generate a notation of jobname, jobid... maybe smf data is too tough for the people who are spending more time collecting statistics than writting good application code.

spent years working with gdg's,
never had to have the date of a file as part of the file name,
always was able to recall the proper file.

why build something new, when the old
- if you bother to understand it -
works just great.

but then again, maybe it is due to companies hiring people
who don't know dogshit, are untrainable, and do all this
pc stuff in an effort to get around the incompetence.

sorry, did not mean to offend you at all.

but, if my comments above offended anyone at a site that employess such stuff:
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Aug 09, 2011 3:20 am
Reply with quote



or to my friends in the bar:
Back to top
View user's profile Send private message
Soumik Das

New User


Joined: 06 Aug 2011
Posts: 25
Location: India

PostPosted: Tue Aug 09, 2011 6:11 pm
Reply with quote

Agreed with Dick..the best way is to pull info from TCB.

If you want to get the details of an already submitted job. You can use SDSF commands via REXX, or use TSO SUBMIT and trap output using OUTTRAP.

These topics should help you with both
http://ibmmainframes.com/post-60793.html.
http://ibmmainframes.com/about54926.html
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Aug 09, 2011 6:15 pm
Reply with quote

OK, weather in Chamonix is excellent, so maybe this will run and run.

I'm joining Marso. Can you move over a little, fine, thanks. Fancy a tea? I brought a Thermos. Biscuit? Nice view from up here.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Aug 09, 2011 8:27 pm
Reply with quote

Quote:
OK, weather in Chamonix is excellent,

lets say that it was possible to walk around icon_biggrin.gif
pretty cold anyway, at 2500 meters after 2 pm drops of rain or something even colder

here the link to chamonix meteo com
chamonix-meteo.com/bul/metPreMatFr.php
the period of sunshine close to 60%. was more really about 20%
( and I do not usually complain too much, useless after You have started walking )

lurking waiting for the laundry to dry icon_biggrin.gif
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Aug 10, 2011 2:48 pm
Reply with quote

ppandey07 wrote:
I am trying to submit a job and simultaneosuly trying to put the job id in the test file?
All this SORT and Assembler and COBOL and REXX stuff is very nice and useful, but I think Pankaj needs something else.

Maybe something like:
Code:
   Call OUTTRAP('Lst.')                       
   "SUBMIT 'hlq.SPF.CNTL(IEFBR14)'"       
   Call OUTTRAP("OFF")                         
                                               
   Do iX = 1 To Lst.0                         
      If Word(Lst.iX,1) = 'IKJ56250I' Then Do 
         Parse Var Lst.iX . '(' JobID ')' .   
         Say 'JobID is 'JobID                 
         Leave                                 
      End                                     
   End                                         

1. I assumed TSO PROF MSGID to get the IKJ message ID.
2. "SUBMIT *" generates two messages, so I used a loop, just to be on the safe side.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Aug 10, 2011 3:01 pm
Reply with quote

Sorry Bill,
I couldn't keep quiet...
But tea and biscuits is fine, although a nice cold beer would be nice too
(when the weather man say 'tomorrow will be colder' he means temperature will drop from 32C (89.6F) to 30C (86F))
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 10, 2011 3:15 pm
Reply with quote

Marso,

Good idea. Same sort of thing here, at the moment a touch hotter. Nice at 5am when sometimes below 20 degrees. I'm jealous of enrico's mountain climate holiday. For a few days, at least. Now, beer... Super Bock or Sagres?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top