IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To allocate a DDNAME to a file


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nidhi sethi

New User


Joined: 05 Jul 2008
Posts: 3
Location: delhi

PostPosted: Sun Oct 19, 2008 9:43 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Oct 19, 2008 9:56 am
Reply with quote

Hello Nidhi and welcome to the forum,

First -TURN OFF YOUR CAPS icon_sad.gif

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Sun Oct 19, 2008 10:10 pm
Reply with quote

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
View user's profile Send private message
nidhi sethi

New User


Joined: 05 Jul 2008
Posts: 3
Location: delhi

PostPosted: Sun Oct 19, 2008 11:13 pm
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Oct 20, 2008 1:13 am
Reply with quote

ISPF variables within REXX are concatenated the same way as REXX variables.

O.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Mon Oct 20, 2008 7:42 am
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Oct 20, 2008 1:48 pm
Reply with quote

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
Code:
"FREE F(REF)"
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
View user's profile Send private message
nidhi sethi

New User


Joined: 05 Jul 2008
Posts: 3
Location: delhi

PostPosted: Wed Oct 22, 2008 10:15 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Oct 22, 2008 10:43 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Thu Oct 23, 2008 1:09 am
Reply with quote

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
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Oct 23, 2008 9:38 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top