Page 1 of 2

Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 7:03 pm
by DonkeyKong
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.

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 7:30 pm
by enrico-sorichetti
all depends on Your organization standards

what happens when You submit a job without the job card ?

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 7:40 pm
by DonkeyKong
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

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 8:40 pm
by enrico-sorichetti
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

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 9:04 pm
by DonkeyKong
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.

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 9:14 pm
by Terry Heinze
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

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 9:35 pm
by enrico-sorichetti
I think. I can't seem to track down the output in SDSF though.


what about PREFIX <youruserid>*

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 9:45 pm
by Terry Heinze
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.

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 10:28 pm
by DonkeyKong
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

Re: Auto-generate userid in job card name

PostPosted: Wed Apr 22, 2015 10:46 pm
by DonkeyKong
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