Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To allocate a DDNAME to a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: To allocate a DDNAME to a file
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

Site Director


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

PostPosted: Sun Oct 19, 2008 9:56 am    Post subject:
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

Senior Member


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

PostPosted: Sun Oct 19, 2008 10:10 pm    Post subject: Reply to: To allocate a DDNAME to a file
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    Post subject: Reply to: To allocate a DDNAME to a file
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: 2360
Location: Israel

PostPosted: Mon Oct 20, 2008 1:13 am    Post subject:
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

Senior Member


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

PostPosted: Mon Oct 20, 2008 7:42 am    Post subject: Reply to: To allocate a DDNAME to a file
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: 1226
Location: Israel

PostPosted: Mon Oct 20, 2008 1:48 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Oct 22, 2008 10:43 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Oct 23, 2008 1:09 am    Post subject: Reply to: To allocate a DDNAME to a file
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: 1226
Location: Israel

PostPosted: Thu Oct 23, 2008 9:38 pm    Post subject: Reply to: To allocate a DDNAME to a file
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us