View previous topic :: View next topic
|
Author |
Message |
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
Hi All,
Can some one plz provide a rexx routine which will add the JOBCARD at the begining
In my application there is a tool which will generate the JCL automatica rexx procedure which will add the JOBCARD at the beginingclly without the jbocard then we need to add the JOBCARD manually at the begining
Can some one please help we with a REXX routine which will add the jobcard at the begining (some thing like when i open the dataset member and use the REXX routine the jobcard should add at the begining
Thanks n Regards
Prasad |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I usually use an edit macro which does that.
The member $JOBCARD is in the same JCL library as the member being edited - I do this in batch every time that I go to a new site.
And the code is
"ISREDIT COPY $JOBCARD BEFORE 1"
And using further edit commands tailor the jobcard to the standards and specifications of the site that I work at. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Save below in a member of your REXX lib. and just enter that member name while editing a JCL in which you want Jobcard to be entered. Customize it as per your site standards.
Code: |
/* 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 = '//* '" |
|
|
Back to top |
|
|
sivatechdrive
Active User
Joined: 17 Oct 2004 Posts: 191 Location: hyderabad
|
|
|
|
Hello agkshirsagar
Thanks for the details
but i don't have authoirizations to create a member in the REXX library
hence can i save the code in my own dataset member & execute it
Thanks n Regards
Prasad |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
You can create and execute a REXX from your own library if you want to. |
|
Back to top |
|
|
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
Thanks for answering my query in REXX
I need some help from you.
As per our requirement we need to add the JOB Card at the begining of the dataset.The dataset 'UESR.NSW.CNTL(V3511MA8)' will not have the JOB card details and
I had written the REXX code in 'UESR.EM9090.RND(SIVA)' & it is a private library.
How to i execute the REXX routine such that the JOB CARD is appended at the begining
VIEW ,UESR.NSW.CNTL(V3511MA8) - 01.03 ,Spalten,00001,00072,
Befehl ===>, ,Bl{ttern ===>,CSR ,
******,**************************** Datenanfang *******************************
000001,//*********************************************************************
000002,//*
000003,//* IFRS TESTZYKLUS 5 : ULTIMO JUNI (-1) *
000004,//*
000005,//*********************************************************************
000006,//JOBLIB DD DISP=SHR,DSN=UESR.RUP.LOD
000007,// DD DISP=SHR,DSN=UESR.IFRS.LOD
000008,// DD DISP=SHR,DSN=UESR.KVS.LOD
000009,// DD DISP=SHR,DSN=UESR.NSW.LOD
000010,// DD DISP=SHR,DSN=DB3B.ANW.RUNLIB.LOAD
VIEW ,UESR.EM9090.RND(SIVA) - 01.00 ,Spalten,00001,000
Befehl ===>, ,Bl{ttern ===>,CS
******,**************************** Datenanfang ****************************
000100,/* REXX */
000200,ADDRESS ISREDIT
000300,'MACRO'
000400,"LINE_AFTER 0 = '//"USERID()"A JOB (,,,,),'"
000500,"LINE_AFTER 1 = '// XXXXX, '"
000600,"LINE_AFTER 2 = '// CLASS=V, '"
000700,"LINE_AFTER 3 = '// NOTIFY=XXXXXX, '"
000800,"LINE_AFTER 4 = '// MSGCLASS=X'"
000900,"LINE_AFTER 5 = '//* '" |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Code: |
/* 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 saved it in my REXX library and when I execute its not adding jobcard to the jcl but the rexx is executing sucessfully |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Your main REXX routine should contain something like
"ISPEXEC EDIT DATASET('dataset name') MACRO('macro name')"
Not 100% sure on the syntax as I don't have MF access until Monday 18th. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
What is MACRO name here? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
What is MACRO name here? |
What do you want to call it ? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I tried this given code
Code: |
"ISPEXEC EDIT DATASET('dataset name') MACRO('macro name')"
|
But its not working.When i execute this its opening my rexx lib say suppose i gave my rexx lib which has some job also.So how to edit there |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Can you please explain me with a code?
No actually my question is why it is not entering a jobcard to my job? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Why not post exactly what you have coded and then it will be much easier to see what is happening. |
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
hi,
in order to execute your rexx routines, you need to concatinate the PDS where your rexx routines reside with the system libraries..
Please type TSO ISRDDN to list down all your system libraries...
~Vamsi |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
This is my modified code
Code: |
/*REXX*/
TRACE ALL
ADDRESS
"ISPEXEC EDIT DATASET('prem.REXX') MACRO('MACRO')"
ADDRESS ISREDIT 'MACRO'
"LINE_AFTER 0 = '//"USERID()"A JOB (),'"
"LINE_AFTER 1 = '// XXXXX, '"
"LINE_AFTER 2 = '// CLASS=6, '"
"LINE_AFTER 3 = '// NOTIFY=xxxxxx, '"
"LINE_AFTER 4 = '// MSGCLASS=X'"
"LINE_AFTER 5 = '//* '"
|
When I execute this code it OPEN'S prem.REXX pds and list all lists all the members when I try to open the member in that lit list.It displays 'MACRO' in the command line and also displays invalid command in the right hand corner.In that edit entry panel
Its like this
Code: |
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
EDIT PREM.REXX(SORT2) - 01.01 Command name is invalid
Command ===> 'MACRO' Scroll ===> CSR
****** ***************************** Top of Data ******************************
==MSG> -Warning- The UNDO command is not available until you change
==MSG> your edit profile using the command RECOVERY ON.
|
where I am trying to add that jobcard in my sort2. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Code: |
ADDRESS ISREDIT 'MACRO'
"LINE_AFTER 0 = '//"USERID()"A JOB (),'"
"LINE_AFTER 1 = '// XXXXX, '"
"LINE_AFTER 2 = '// CLASS=6, '"
"LINE_AFTER 3 = '// NOTIFY=xxxxxx, '"
"LINE_AFTER 4 = '// MSGCLASS=X'"
"LINE_AFTER 5 = '//* '"
"ADRESS ISREDIT END"
|
Should be in a different member from the main REXX code. The library in which this member exists should also be concatenated into your SYSEXEC statement.
Let us assume that we create this member and call it MACRO99
And the calling code should be something like
Code: |
"ISPEXEC EDIT DATASET('prem.REXX(member)') MACRO('MACRO99')"
|
|
|
Back to top |
|
|
shreevamsi
Active User
Joined: 23 Feb 2006 Posts: 305 Location: Hyderabad,India
|
|
|
|
that what i was trying to explain!!
u got a message that command not found!!
This is because your TSO Session couldn't locate your REXX macro to add joobcard. U need to concatenate your 'PREM.REXX' library with the system libraries where all other rexx utilities resides..
~Vamsi |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I modified it now and I changed the code accordingly but I get the same error . |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Are you running in batch or online ? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
I am trying to execute that main rexx part alone so it leads to the following error. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
Are you running in batch or online ? |
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
online |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Try doing this at the start of your REXX code
Code: |
"ALTLIB DEACTIVATE USER(*)"
"FREE FI(SYSUEXEC,SYSUPROC)"
"ALLOC FI(SYSUEXEC) DA('"xxxxxx".REXX') SHR REU"
"ALLOC FI(SYSUPROC) DA('"xxxxxx".REXX') SHR REU"
"ALTLIB ACTIVATE USER(*)"
|
|
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
What if I am trying the same thing in batch does it have any change or shall I use the same old rexx ? |
|
Back to top |
|
|
|