Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How can I get jobid of a submitted job in a test file?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How can I get jobid of a submitted job in a test file?
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    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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    Post subject: Re: Reply to: How can I get jobid of a submitted job in a te
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: 1439
Location: Bangalore,India

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

Pankaj,

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

Moderator Team Head


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

PostPosted: Mon Aug 08, 2011 7:07 pm    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Aug 08, 2011 7:11 pm    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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

Site Director


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

PostPosted: Mon Aug 08, 2011 7:38 pm    Post subject:
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:
http://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    Post subject:
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:
http://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: 1218
Location: Israel

PostPosted: Mon Aug 08, 2011 8:07 pm    Post subject:
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: 1445
Location: Azeroth

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

A REXX version of D's job.
http://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    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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    Post subject: Re: Reply to: How can I get jobid of a submitted job in a te
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Mon Aug 08, 2011 9:31 pm    Post subject: Re: Reply to: How can I get jobid of a submitted job in a te
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

Site Director


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

PostPosted: Mon Aug 08, 2011 9:47 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 09, 2011 12:06 am    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Tue Aug 09, 2011 2:33 am    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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    Post subject:
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    Post subject:
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    Post subject: Reply to: How can I get jobid of a submitted job in a test f
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
This topic is locked: you cannot edit posts or make replies. Get a job submitted itself every time... arunsoods JCL & VSAM 3 Tue Nov 22, 2016 4:05 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us