Auto-generate userid in job card name



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Auto-generate userid in job card name

Postby DonkeyKong » Wed Apr 22, 2015 7:03 pm

Is it possible for me to get the userid to be automatically detected and placed in the job card so that it is not necessary to hard code it?

For Example...

Instead of this:
000001 //XQWRERTYA JOB (X9999),'LOCATE FILES',CLASS=T,MSGCLASS=Y,
000002 // NOTIFY=&SYSUID,REGION=0M

Have something like this:
000001 //&SYSUIDA JOB (X9999),'LOCATE FILES',CLASS=T,MSGCLASS=Y,
000002 // NOTIFY=&SYSUID,REGION=0M

here the &SYSUID would resolve to my userID (XQWERTY) and the job runs and I didn't have to manual change the JOB Card Name.
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Auto-generate userid in job card name

 

Re: Auto-generate userid in job card name

Postby enrico-sorichetti » Wed Apr 22, 2015 7:30 pm

all depends on Your organization standards

what happens when You submit a job without the job card ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2775
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 147 times

Re: Auto-generate userid in job card name

Postby DonkeyKong » Wed Apr 22, 2015 7:40 pm

If it's missing the job name it says ""ENTER JOBNAME CHARACTER(S) -" and then it JCL error's out

If it's missing the whole job card it says "ENTER JOBNAME CHARACTER(S) -" and then it JCL error's out
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Auto-generate userid in job card name

Postby enrico-sorichetti » Wed Apr 22, 2015 8:40 pm

for case 1 ...
the JOB card without the job name
is considered and END of JOB statement
and the job fails because it contains no steps

for case 2 ...
missing job card . ask Your support,
it works for me

     
        0.00 MINUTES EXECUTION TIME
        1 //ENRICOZ   JOB ESYZ,
          //             ENRICO,        **JOB STATEMENT GENERATED BY SUBMIT**
          //             NOTIFY=ENRICO,CLASS=A,
          //             MSGLEVEL=(1,1)
        2 //G       EXEC PGM=IEFBR14
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2775
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 147 times

Re: Auto-generate userid in job card name

Postby DonkeyKong » Wed Apr 22, 2015 9:04 pm

Ok. That did work... I think. I can't seem to track down the output in SDSF though. Do you know where it would be? Thanks.
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Auto-generate userid in job card name

Postby Terry Heinze » Wed Apr 22, 2015 9:14 pm

I use an edit macro like the following to generate my JOB statement:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
/*                                                                    */
/*  JS       -  INSERT A JOB STATEMENT AT THE BEGINNING OF THE        */
/*              DATASET BEING EDITED.                                 */
/*                                                                    */
/*  AUTHOR   -  MAINFRAME JOURNAL                                     */
/*  CREATED  -  12/07/1989                                            */
/*  CHANGED  -  04/16/2015                                            */
/*                                                                    */
ISREDIT MACRO
SET ME = &NRSTR(&&&&SYSUID)
ISREDIT LINE_AFTER  0 = "//&SYSUID.XX JOB (YYYYY,ZZZZ),+
                       'YOUR NAME    -- 9999'," /* <-- CHANGE THIS PARM
ISREDIT LINE_AFTER  1 = "//             CLASS=B,"           /* JOB
ISREDIT LINE_AFTER  2 = "//             MSGCLASS=H,"        /* STATEMENT
ISREDIT LINE_AFTER  3 = "//*            RESTART=PROCNAME.SXX,"  /* AND
ISREDIT LINE_AFTER  4 = "//             NOTIFY=&ME"        /* PARAMETERS
ISREDIT LINE_AFTER  5 = "//*  I AM '&SYSUID..AAAA.JCL.BBBB(XXXXXXXX)'"
ISREDIT LINE_AFTER  6 = "//*"
ISREDIT LINE_AFTER  7 = "//*"
SET &ZEDSMSG = JOB STATEMENT INSERTED               /* FILL    SHORT MSG
SET &ZEDLMSG = A JOB STATEMENT HAS BEEN INSERTED AT THE BEGINNING +
               OF THIS DATASET                      /* FILL    LONG  MSG
ISPEXEC SETMSG MSG(ISRZ000)                         /* DISPLAY SHORT MSG
.... Terry
Terry Heinze
 
Posts: 209
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: Auto-generate userid in job card name

Postby enrico-sorichetti » Wed Apr 22, 2015 9:35 pm

I think. I can't seem to track down the output in SDSF though.


what about PREFIX <youruserid>*
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2775
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 147 times

Re: Auto-generate userid in job card name

Postby Terry Heinze » Wed Apr 22, 2015 9:45 pm

enrico-sorichetti wrote:
I think. I can't seem to track down the output in SDSF though.


what about PREFIX <youruserid>*


...And don't forget the * after your userid.
.... Terry
Terry Heinze
 
Posts: 209
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 10 times
Been thanked: 11 times

Re: Auto-generate userid in job card name

Postby DonkeyKong » Wed Apr 22, 2015 10:28 pm

Thanks for the replies. I think my lost jobs is a different issue I'm having. This job does some jumping around between environments so it probably has something to do with that.

Terry - thanks for that macro I'll have to look into this. I haven't used macros yet.

There might be some other issues with the job that are preventing me from running right now but I will keep experimenting with this and post back if I get any results
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Auto-generate userid in job card name

Postby DonkeyKong » Wed Apr 22, 2015 10:46 pm

So there is one thing that might be important, I am doing an instream JCL submit using INTRDR. I also want this one to be self generating but that doesn't seem to be working. Without the job card hardcoded for INTRDR it doesn't run. Any ideas?

If I have the instream card hardcoded, then the job will complete successfully if I leave the master job card blank. That takes care of 1 job card, but the second job card still has to be hardcoded. Also, I still have not been able to locate my output when i run without a job card lol
DonkeyKong
 
Posts: 34
Joined: Thu Oct 02, 2014 7:51 pm
Has thanked: 3 times
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post