IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Rexx routine which will add the JOBCARD at the begining


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Thu Jun 07, 2007 11:31 am
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Jun 07, 2007 12:29 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Thu Jun 07, 2007 6:18 pm
Reply with quote

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.
icon_smile.gif
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
View user's profile Send private message
sivatechdrive

Active User


Joined: 17 Oct 2004
Posts: 191
Location: hyderabad

PostPosted: Fri Jun 08, 2007 6:38 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jun 08, 2007 6:49 pm
Reply with quote

You can create and execute a REXX from your own library if you want to.
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Tue Jun 12, 2007 2:21 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 2:32 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 2:36 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 2:41 pm
Reply with quote

What is MACRO name here?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 2:43 pm
Reply with quote

Quote:
What is MACRO name here?


What do you want to call it ?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 2:53 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 3:15 pm
Reply with quote

Have a read of the fine manual ............

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPZEM40/CCONTENTS?DT=20050712213335
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 4:42 pm
Reply with quote

Can you please explain me with a code?
No actually my question is why it is not entering a jobcard to my job? icon_confused.gif icon_confused.gif icon_confused.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 4:57 pm
Reply with quote

Why not post exactly what you have coded and then it will be much easier to see what is happening.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Jun 12, 2007 5:03 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 5:07 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 5:13 pm
Reply with quote

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
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Tue Jun 12, 2007 5:17 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 5:26 pm
Reply with quote

I modified it now and I changed the code accordingly but I get the same error icon_sad.gif icon_sad.gif icon_sad.gif icon_sad.gif icon_sad.gif icon_sad.gif .
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 5:29 pm
Reply with quote

Are you running in batch or online ?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 5:33 pm
Reply with quote

I am trying to execute that main rexx part alone so it leads to the following error.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 5:46 pm
Reply with quote

Quote:
Are you running in batch or online ?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 6:35 pm
Reply with quote

online
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Tue Jun 12, 2007 6:48 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Tue Jun 12, 2007 7:28 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Run rexx with JCL Job CLIST & REXX 1
No new posts Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
Search our Forums:

Back to Top