View previous topic :: View next topic
|
Author |
Message |
nidhi sethi
New User
Joined: 05 Jul 2008 Posts: 3 Location: delhi
|
|
|
|
Hi,
SUPPOSE 'OUT' IS A VARIABLE WHOSE VALUE IS RECEIVED FROM THE PANEL.AND I WANT TO AALOCATE A DDNAME TO THIS VARIABLE FOR EXECIO PURPOSE.
"ALLOC DA('OUT') DDNAME(REF) SHR"
HOW CAN THIS BE DONE OR TELL THE PROBABLE SYNTAX FOR IT????
THANKS,
NIDHI |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello Nidhi and welcome to the forum,
First -TURN OFF YOUR CAPS
Second, when you use the forum SEARCH (specify the clist/rexx part of the forum), you will find multiple examples. Hint - look for alloc and execio.
If you find something that is not clear, post what you found and your question about it. Someone will be able to clarify. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
Quote: |
"ALLOC DA('OUT') DDNAME(REF) SHR" |
You are mixing single quotes with double quotes.
Should be something like this:
Quote: |
var1 = "OUT"
"ALLOC DA("var1") DDNAME(REF) SHR" |
|
|
Back to top |
|
|
nidhi sethi
New User
Joined: 05 Jul 2008 Posts: 3 Location: delhi
|
|
|
|
HI
The piece of code you gave works if variable's value is taken from rexx progam.what if value is coming from an ispf panel and i have to allocate a ddname to the file received from the panel.In this case it doesnt work.
Thanks |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
ISPF variables within REXX are concatenated the same way as REXX variables.
O. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
I was trying to show how to issue the ALLOC command with a variable for the DDname. The variable can be set by rexx or from a panel. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
REXX Basic rule: if a word is not within quotes, REXX will check if it is a variable. If it is, REXX will replace the word with its value.
It could be:
Code: |
"ALLOC F(REF) DA('"OUT"') SHR" |
followed by:
Code: |
"EXECIO * DISKR REF (FINIS STEM LineIn." |
and
then you can use (for example):
Code: |
Do I = 1 To LineIn.0
Say "Processing line: "LineIn.I
Call Main_Process
End |
[/code] |
|
Back to top |
|
|
nidhi sethi
New User
Joined: 05 Jul 2008 Posts: 3 Location: delhi
|
|
|
|
hey marso,
OUT is a variable whose value is coming from the panel eg. OUT = 'xads.data' but specifying the OUT as u specified is not working.Rather than interpreting it as a variable it interprets it as 'userid.out' |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Then I would hazard a guess that you may have a problem in your panel definition where the variable OUT is not being recognised correctly. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2546 Location: Silicon Valley
|
|
|
|
It sounds like you did not specify your ALLOC statement correctly.
Code: |
"ALLOC F(REF) DA('"OUT"') SHR" |
Notice the use of single quotes and double quote characters[/quote] |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
The fact that you say 'userid.out' instead of just 'out' means that the dsname was not enclosed in single-quotes.
Please check again. |
|
Back to top |
|
|
|