Need help to Create Jobcard through ReXX



IBM's Command List programming language & Restructured Extended Executor

Need help to Create Jobcard through ReXX

Postby akki1007 » Wed Mar 26, 2014 11:51 am

In my previous project we use to write a command like jobcard in any jcl then automatically jabcard was created at the first line of the job.

So here I'm looking for the same, like how can I create a similar program which can create a jobcard.

Through google I got the below code :), I'm not sure if this is right:

/*REXX*/
ADDRESS ISREDIT
'MACRO'
"LINE_AFTER 0 = '//"USERID()"A JOB (,,,,),'"
"LINE_AFTER 1 = '// xxxxx, '"
"LINE_AFTER 2 = '// CLASS=V, '"
"LINE_AFTER 3 = '// NOTIFY=xxxxxx, '"
"LINE_AFTER 4 = '// MSGCLASS=x'"
"LINE_AFTER 5 = '//* '"

I tried it by putting this in my library and Rexx Library but no luck, Could anyone please advice?

Thanks.
akki1007
 
Posts: 2
Joined: Wed Mar 26, 2014 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need help to Create Jobcard through ReXX

Postby NicC » Wed Mar 26, 2014 2:55 pm

Turn trace on to show what is happening (or not happening). what do you mean by "no luck" - we were not there to observe so we have no idea. Did you submit the job? If so - how? is that jobcard to be permanent? If not - why not (why waste resources and time recreating soemthing that is constant). If not permanent did you cancel out of the macro/member?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need help to Create Jobcard through ReXX

Postby akki1007 » Wed Mar 26, 2014 5:51 pm

NicC wrote:Turn trace on to show what is happening (or not happening). what do you mean by "no luck" - we were not there to observe so we have no idea. Did you submit the job? If so - how? is that jobcard to be permanent? If not - why not (why waste resources and time recreating soemthing that is constant). If not permanent did you cancel out of the macro/member?


Hi NicC,
I tried to execute the job just by "ex" command in front of rexx member(having the code as I mentioned in my previous post).
no luck -> results were not expected :)
Ok, the thing is when we write a new JCL we need to write the job card, So I was thinking if I can create a similar utility by which just passing the jobcard(or any name) in command line we get the automatic jobcard at first line.

Something like that:
I would creat a member testjcl, open it in edit mode. At command line if I just type jobcard and press enter a jobcard would appear at the first line.

I hope I'm able to clarify :?
akki1007
 
Posts: 2
Joined: Wed Mar 26, 2014 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: Need help to Create Jobcard through ReXX

Postby dick scherrer » Wed Mar 26, 2014 7:26 pm

Hello and welcome to the forum,

You still have not explained what happened . . . "Results were not expected" tells us Nothing. Is there some reason you did not run a trace and post the result of the trace?

Why not just have a 'jobcard' member and copy it on top of your jcl? Why spend the extre resources to create one on the fly every time you submit a job? Once created the full JCL could be saved for subsequent runs.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Need help to Create Jobcard through ReXX

Postby NicC » Wed Mar 26, 2014 7:59 pm

What you have is an edit macro - you need to be editing the data before you can issue the command. What you may need is a rexx program. but what is wrong with simply having a jobcard in a member all by itself and copying that in whilst you are creating the rest of the JCL? Or you can copy just the first line(s) of another, complete, job. And, as the usual way to create a new job, for me anyway, is to copy an existing job and modify it to requirements the jobcard is already there!
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need help to Create Jobcard through ReXX

Postby Terry Heinze » Wed Mar 26, 2014 8:45 pm

To avoid having to store a JOB statement in more than one PDS, I've been using a version of this edit macro for many years. My CLIST library needs to be concatenated in my TSO SYSPROC DD:
 CPUID     USERID.CLIST(JS) - 01.18                   Line 00000000 Col 001 080
 Command ===>                                                  Scroll ===> CSR
********************************* Top of Data **********************************
/*                                                                    */
/*  JS       -  INSERT A JOB STATEMENT AT THE BEGINNING OF THE        */
/*              DATASET BEING EDITED.                                 */
/*                                                                    */
/*  AUTHOR   -  MAINFRAME JOURNAL                                     */
/*  CREATED  -  12/07/1989                                            */
/*  CHANGED  -  03/20/2014                                            */
/*                                                                    */
ISREDIT MACRO
SET ME = &NRSTR(&&&&SYSUID)
ISREDIT LINE_AFTER 0 = "//&SYSUID.XX JOB (YYYYY,ZZZZ),+
                       'YOUR    NAME -- NNNN'," /* <-- CHANGE THIS PARM
ISREDIT LINE_AFTER 1 = "//             CLASS=B,"           /* JOB
ISREDIT LINE_AFTER 2 = "//             MSGCLASS=H,"        /* STATEMENT
ISREDIT LINE_AFTER 3 = "//*            RESTART=XXXXXXXX.XXX,"  /* AND
ISREDIT LINE_AFTER 4 = "//             NOTIFY=&ME"         /* PARAMETERS
ISREDIT LINE_AFTER 5 = "//*  I AM '&SYSUID..ABCD.JCL(XXXXXXXX)'"
ISREDIT LINE_AFTER 6 = "//*"
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: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: Need help to Create Jobcard through ReXX

Postby Pedro » Thu Mar 27, 2014 1:51 am

It is not clear if you got it to work.

But it should work as you describe:
I would <like to> create a member testjcl, open it in edit mode. At command line if I just type JOBCARD and press enter a jobcard would appear at the first line.
Assuming that the name of your edit macro is JOBCARD.

It is not clear why you tried something that you did not want to do:
I tried to execute the job just by "ex" command in front of rexx member
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post