View previous topic :: View next topic |
Author |
Message |
kris_madras Beginner
Joined: 07 Apr 2004 Posts: 46 Topics: 29
|
Posted: Tue May 04, 2004 1:27 am Post subject: Passing paramters from jcl to rexx |
|
|
Hi,
Anybody please post a reply how to access parameters from the jcl in a rexx program.(rexx is in batch execution)
Thanks
Krishna |
|
Back to top |
|
|
kris_madras Beginner
Joined: 07 Apr 2004 Posts: 46 Topics: 29
|
Posted: Tue May 04, 2004 2:45 am Post subject: |
|
|
Hi,
Its working fine... Thanks a lot...
Krishna |
|
Back to top |
|
|
kris_madras Beginner
Joined: 07 Apr 2004 Posts: 46 Topics: 29
|
Posted: Tue May 04, 2004 2:59 am Post subject: |
|
|
Hi,
This reply for your changed program. Even if I mentioned
PARSE ARG NAME alone(1 argument) in REXX program, its accepting both SAI
and MADRAS....
Krishna |
|
Back to top |
|
|
Mike Beginner
Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Tue May 11, 2004 7:41 pm Post subject: |
|
|
try (note the period/fullt stop)
PARSE ARG NAME . _________________ Regards,
Mike. |
|
Back to top |
|
|
Maton_Man Beginner
Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Wed May 12, 2004 2:00 am Post subject: |
|
|
Why don't follow your own advice Ravi and read TSO/E REXX Reference- Chapter 5. Parsing ...
The '.' is a place holder. In Mike's example he is:
1. Using PARSE to maintain case
2. Using ARG to accept parameter input
3. Accepting one parameter into a variable called NAME the value of which will be everything from the first non-blank character up to the first blank character.
4. Discarding everything beyond the first blank character into the '.' placeholder.
So in this case you are passing the parameters 'Kris Madras' to the rexx 'Hello' and it is putting Kris into NAME and everything else into '.' Be aware also that the parameter buffer is padded with spaces, so if you were to do:
PARSE ARG NAME SURNAME
Then SURNAME would be equal to 'Madras ' (I have not put all the spaces in, just enough to demonstrate the effect.
The period is a useful device for removing these trailing spaces so a more useful PARSE statement in your case would be:
PARSE ARG NAME SURNAME .
Which would put 'Kris' into NAME, 'Madras' into SURNAME and spaces into '.'
You can use multiple period placeholders anywhere in a parse statement to ignore parts of the string you are not interested in. _________________ My opinions are exactly that. |
|
Back to top |
|
|
|
|