View previous topic :: View next topic |
Author |
Message |
dubasir Beginner
Joined: 13 Dec 2004 Posts: 20 Topics: 9
|
Posted: Wed Jun 27, 2007 7:12 am Post subject: Need Help in Splitting the REXX Code. |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Jun 27, 2007 7:17 am Post subject: |
|
|
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 |
|
 |
dubasir Beginner
Joined: 13 Dec 2004 Posts: 20 Topics: 9
|
Posted: Wed Jun 27, 2007 7:37 am Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Jun 27, 2007 7:46 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Jun 27, 2007 8:08 am Post subject: |
|
|
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 |
|
 |
dubasir Beginner
Joined: 13 Dec 2004 Posts: 20 Topics: 9
|
Posted: Thu Jun 28, 2007 7:49 am Post subject: |
|
|
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 |
|
 |
Bill Dennis Advanced

Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Thu Jun 28, 2007 7:57 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 8:44 am Post subject: |
|
|
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 |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Thu Jun 28, 2007 9:04 am Post subject: |
|
|
oops. var1 2 and 3 should not be in quotes. That makes them literals |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 9:10 am Post subject: |
|
|
thx semigeezer,
corrected the original..... _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Jun 28, 2007 11:17 am Post subject: |
|
|
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 |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu Jun 28, 2007 11:29 am Post subject: |
|
|
deleted by dbz _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
dubasir Beginner
Joined: 13 Dec 2004 Posts: 20 Topics: 9
|
Posted: Fri Jun 29, 2007 12:55 am Post subject: |
|
|
Thanks for your responses. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Sat Jun 30, 2007 4:37 am Post subject: |
|
|
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 |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Sat Jun 30, 2007 6:48 am Post subject: |
|
|
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 |
|
 |
|
|