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 

Need Help in Splitting the REXX Code.
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
dubasir
Beginner


Joined: 13 Dec 2004
Posts: 20
Topics: 9

PostPosted: Wed Jun 27, 2007 7:12 am    Post subject: Need Help in Splitting the REXX Code. Reply with quote

In my REXX Code I have the following :
Code:

/* REXX */
/*----------------------- Input Portion------------------ */
Input_PDS = 'File.Input'
Output_PDS = 'File.Output'
Report_PDS = 'File.Report'
/*-------------------------------------------------------- */

/*******From the below Portion I have the processing logic *********

Question : When ever I execute the above code, I change only the input protion and I don't want the code to be visible. So, I just want to split them into 2 parts, and allow the Input part "Update Authorization" and the Processing Part only "Read Authorization". Please help me out how it can be done . Thanks in Advance.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Jun 27, 2007 7:17 am    Post subject: Reply with quote

dubasir,

I had read it couple of times to understand as to what you are asking. From what I understood simply pass the following variables as parms to the processing logic macro

Code:

Input_PDS
Output_PDS
Report_PDS


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dubasir
Beginner


Joined: 13 Dec 2004
Posts: 20
Topics: 9

PostPosted: Wed Jun 27, 2007 7:37 am    Post subject: Reply with quote

kolusu,
I am sorry....the processing logic isn't a macro. The processing logic has reading the input files and then generating output into Output_PDS & Report_PDS etc.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Jun 27, 2007 7:46 am    Post subject: Reply with quote

Do you mean that to exec the REXX you first EDIT it to change the file names? And now you don't want the logic portion visible to the person editing the file names?
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Jun 27, 2007 8:08 am    Post subject: Reply with quote

Do you want to execute the REXX script as:

<REXX script name> input.dsn,output.dsn,report.dsn

just change your REXX Script to have 3 arguments and modify your script to access the arguments.

Start here
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
dubasir
Beginner


Joined: 13 Dec 2004
Posts: 20
Topics: 9

PostPosted: Thu Jun 28, 2007 7:49 am    Post subject: Reply with quote

Bill Dennis, you are absolutely right. Please let me know how it can be done.
Would be great if you can give me any example.
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Jun 28, 2007 7:57 am    Post subject: Reply with quote

Do as Dick suggested and pass the file names as argument strings so the user never sees the REXX code.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 8:44 am    Post subject: Reply with quote

here is one way that you can do it:
Code:

/*------REXX----*/
arg var1 var2 var3
all_ok = 0
if length(var1) = 0 then do
   all_ok = 1
   say "input-dsn required"
   end
if length(var2) = 0 then do
   all_ok = 1
   say "output-dsn required"
   end
if length(var3) = 0 then do
   all_ok = 1
   say "report-dsn required"
   end
if all_ok = 1 then exit
/*      */
/*   put in validation for proper dsn etc..*/
/*      */
quote = "'"
Input_PDS = quote || var1 || quote
Output_PDS = quote || var2 || quote
Report_PDS = quote || var3 || quote

/*        */
/*    rest of your existing code follows    */
/*        */


corrected via semi's post below
_________________
Dick Brenholtz
American living in Varel, Germany


Last edited by dbzTHEdinosauer on Thu Jun 28, 2007 9:09 am; edited 1 time in total
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Jun 28, 2007 9:04 am    Post subject: Reply with quote

oops. var1 2 and 3 should not be in quotes. That makes them literals
Back to top
View user's profile Send private message Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 9:10 am    Post subject: Reply with quote

thx semigeezer,
corrected the original.....
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Thu Jun 28, 2007 11:17 am    Post subject: Reply with quote

And ...........

I would always use a trailing . after the variable list

because if you should enter A B C but because of finger trouble you enter A B C D
then var 3 will have the value C D instead of C.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Jun 28, 2007 11:29 am    Post subject: Reply with quote

deleted by dbz
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
dubasir
Beginner


Joined: 13 Dec 2004
Posts: 20
Topics: 9

PostPosted: Fri Jun 29, 2007 12:55 am    Post subject: Reply with quote

Thanks for your responses.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sat Jun 30, 2007 4:37 am    Post subject: Reply with quote

I thought there was something 'gotcha' about passing arguments - and there is. You can only pass one external argument to an exec. But, that argument can consist of 3 file names which you can then parse inside the script. Just be aware!
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Sat Jun 30, 2007 6:48 am    Post subject: Reply with quote

HUH ???

Most of my REXX codes accept multiple arguments from the JCL
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
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
Goto page 1, 2  Next
Page 1 of 2

 
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