Page 1 of 2

Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Mon Jun 18, 2012 8:03 pm
by Viswanathchandru
Dear all,

I have a task where i have to extract the list of members in a PDS and write it to a PS and Submit the members sequentially. While submitting this I need to edit a PARM value in all the members. I have an out sketch of how to implement it. But struck at some points. Also, I would need some suggestions on my implementation plan and advice if other way could improve performance.


1. Extract the list of PDS members , Write it to a Temp file ---> I'm planning it with LISTDSI or LMMLIST.
2. Submit with a Change in the PARM -- > Have decided to make it with the ISPF File tailoring services. But here i'm not sure whether i can change a parm value which has got no symbolic value. Please let me know if i'm not clear. Any suggestions or advice would help me a lot. Apologize if i or my thoughts are wrong.


Regards,
Viswa

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Mon Jun 18, 2012 8:31 pm
by Akatsukami
You may be confusing JCL symbols with file-tailoring symbols.

Suppose you have a skeleton, S1, that looks like:
//PATIENCE JOB
//*
//STEPONLY EXEC PGM=FOO,PARM='&BAR'

and your script includes the fragment
bar = "This is a test"
address ispexec "FTOPEN TEMP"
address ispexec "FTINCL S1"
address ispexec "FTCLOSE"

Then your tailored JCL will look like
//PATIENCE JOB
//*
//STEPONLY EXEC PGM=FOO,PARM='This is a test'

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Mon Jun 18, 2012 8:37 pm
by Viswanathchandru
Hello Akatsukami,

Thanks for addressing the post. Sorry for not being clear. here you have mentioned like


//STEPONLY EXEC PGM=FOO,PARM='This is a test'
But in my requirement i already have a PARM value there like

//STEPONLY EXEC PGM=FOO,PARM='xxxxx
which i have to replace it by a different PARM say 'yyyyyy' using ISPF File tailoring services. Please let me know if i need to give any more information on this.


Regards,
Viswa

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Mon Jun 18, 2012 9:37 pm
by Pedro
Please read Akatsukami example more carefully. He provided three examples. The first is the file tailoring skeleton. The third is an example of result of file tailoring. If that is not what you want, please provide samples of what you want, rather than describing it only.

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Mon Jun 18, 2012 10:54 pm
by Akatsukami
Viswanathchandru wrote:Hello Akatsukami,

Thanks for addressing the post. Sorry for not being clear. here you have mentioned like


//STEPONLY EXEC PGM=FOO,PARM='This is a test'
But in my requirement i already have a PARM value there like

//STEPONLY EXEC PGM=FOO,PARM='xxxxx
which i have to replace it by a different PARM say 'yyyyyy' using ISPF File tailoring services. Please let me know if i need to give any more information on this.

What is the justification for the immutability of the skeleton?

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Tue Jun 19, 2012 1:40 am
by Viswanathchandru
Hello akatsukami/pedro, Thanks for addressing the post.


I'm sorry but that is my requirement. I can't edit each JCL manually and change the PARM value as '&XXXX' so that i can pass whatever value i pass before using the ISPEXEC statements. But is there any other way that i can achieve this.? Please advice. Because if i have to edit a JCL manually to insert '&' and then use the tailoring service then submitting it after editing will not be a big work and there fails the requirement. Please suggest.


Regards,
Viswa

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Tue Jun 19, 2012 1:55 am
by dick scherrer
Hello,

In the "library" set up all of the jcl with the same parm value (i.e. 'xxxxxx').

When reading the members for submission, EDIT the value to the needed value for this run and submit. Do NOT change the original member. This way the code does not need to change. You only need to implement a method to take in the run-specific parm(s).

This is a "cheap" way to tailor your jcl . . .

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Tue Jun 19, 2012 2:02 am
by Akatsukami
Viswanathchandru wrote:I'm sorry but that is my requirement. I can't edit each JCL manually and change the PARM value as '&XXXX' so that i can pass whatever value i pass before using the ISPEXEC statements.

Ah, so we're really not talking file tailoring at all, but editing a data set (or PDS member...same thing, more or less). I agree with Gospodin Shostakovich; in fact, you can write an edit macro or Rexx script to do all the work for you. Just don't call it "file tailoring".

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Tue Jun 19, 2012 2:18 am
by Viswanathchandru
Apologize i'm not calling it as File tailoring service. I'm asking whether this is possible through file tailoring services. In other words i would need out sketch on reading a file and if some string is found that string has to be replaced by a different string. Not sure whether it is possible or not. Still searching. Please advice. Apologize if i or my thoughts are wrong.

Regards,
Viswa

Re: Need Sugesstions on REXX/ISPF File tailoring service.

PostPosted: Tue Jun 19, 2012 2:50 am
by Akatsukami
Viswanathchandru wrote:Apologize i'm not calling it as File tailoring service. I'm asking whether this is possible through file tailoring services. In other words i would need out sketch on reading a file and if some string is found that string has to be replaced by a different string. Not sure whether it is possible or not. Still searching. Please advice. Apologize if i or my thoughts are wrong.

Assume that the PARM in the first (or only) step is to be replaced by whatever the user gives as input:
/* Rexx */                                       
  address isredit "MACRO (ESAN)"                 
  trace o                                         
  address isredit                                 
  "F PARM"                                       
                                                 
  if (rc=4) then exit /*No PARM! */               
                                                 
  "(L1) = CURSOR"                                 
  "(D1) = LINE &L1"                               
  p = pos("PARM",d1)                             
                                                 
  if (substr(d1,p+5,1)="'") then do               
    q = pos("'",d1,p+6)                           
    d1 = substr(d1,1,p+5) || esan || substr(d1,q)
    "LINE &L1 = '&D1'"                           
    "SUB"                                         
    "CAN"                                         
  end