MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replacing variables in a job thru REXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
subhi_dhanbad
Beginner


Joined: 30 Sep 2005
Posts: 3
Topics: 2

PostPosted: Tue Dec 06, 2005 2:05 am    Post subject: Replacing variables in a job thru REXX Reply with quote

Hi ,

I am writing a REXX program.
The details are as below :-
1. I am taking some input from users. Say STRING
2. Now I want to replace a variable XXXXX present in a job with this string.
3. After that I have to submit the job thru REXX.

How can I do point no. 2 given above.
Can anyone give me some idea or sample codes for it ?

Thanks,
Subhi.
_________________
Regards,
Subhi B.
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Tue Dec 06, 2005 3:17 am    Post subject: Reply with quote

Just generate the JCL's lines in your REXX, and then submit it from within the REXX, using the SUBMIT command.

O.
________
herbalaire


Last edited by ofer71 on Sat Feb 05, 2011 11:24 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Dec 06, 2005 4:26 am    Post subject: Reply with quote

Subhi_dhanbad,

The simplest way is to use ISPF File Tailoring Skeletons. Very simple to use. Just create the template jcl and store in a PDS. The difference b/w a normal jcl and Skeleton jcl are

1. Prefix an '&' for all Strings you would like to be overridden using REXX. for example, if you want to change a variable XXXXX just change it to '&XXXXX' - something like Symbolic parameter.

2. If there are any other JCL symbolic parameters already present, you need to put two '&&' instead of one '&'.

3. Allocate this JCL library to a DD Name called "ISPSLIB" in your REXX program.

4. Using FTOPEN, FTINCLUDE and FTCLOSE commands, you can open the skeleton JCL, perform symbolic overrides via REXX, save it to a temporary dataset and submit the job.

Example: http://mvsforums.com/helpboards/viewtopic.php?p=16078#16078
http://mvsforums.com/helpboards/viewtopic.php?t=42&highlight=rexx+file+tailoring

For more instructions on File Tailoring Skels, Check the following links.
http://mvsforums.com/helpboards/viewtopic.php?t=3642&highlight=rexx+file+tailoring
http://mvsforums.com/helpboards/viewtopic.php?t=5273&highlight=rexx+file+tailoring

Hope this helps,

Cheers,
Phantom
Back to top
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Wed Dec 07, 2005 3:14 am    Post subject: Reply with quote

You can just use edit macros to edit the job before you submit it. Here is an example that we use:
Code:

/* REXX  Sysvarch Macro sysvars ersetzen */         
'ISREDIT MACRO'                                     
address ispexec 'TBOPEN FPVARS NOWRITE SHARE'       
address ispexec 'TBGET FPVARS'                     
i = 0                                               
do fpvar0                                           
   i = i + 1                                       
   interpret "parse var fpvar"i "parm'='pwert'/*'."
   call xch parm pwert "ALL"                       
end                                                 
address ispexec 'TBCLOSE FPVARS'                   
exit                                               
                                                   
xch:                                               
parse arg var1 var2 var3                           
hx1 = c2x(var1)                                     
hx2 = c2x(var2)                                     
address isredit "C X'"hx1"' X'"hx2"'" var3         
return                                             
Back to top
View user's profile Send private message Visit poster's website
subhi_dhanbad
Beginner


Joined: 30 Sep 2005
Posts: 3
Topics: 2

PostPosted: Thu Dec 08, 2005 6:05 am    Post subject: Reply with quote

Thanx a lots for ur replies.

Cheers,
Subhi.
_________________
Regards,
Subhi B.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group