| Date: | Fri, 1 Aug 2008 09:46:46 +0100 |
| Reply-To: | Ian Wakeling <Ian.Wakeling@HANANI.QISTATS.CO.UK> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Ian Wakeling <Ian.Wakeling@HANANI.QISTATS.CO.UK> |
| Subject: | Re: Debugging problem in proc IML |
| In-Reply-To: | <200808010806.m6VK9ejP002383@malibu.cc.uga.edu> |
| Content-Type: | text/plain; charset="us-ascii" |
Erwan,
Country is indeed undefined when you call the function modNC. I think you
are mixing your variable names and literals.
Try something like
NCou=modNC({country, n});
for the function call. And then modify the read statement to
read all var arg1 into NC where (_type_='100');
In your version, arg1 is part of the literal and so the read statement
would fail when it checked to see if there was a variable called arg1 in the
test1 dataset.
By the way, if country is text and n is numeric then you will have more
problems since an IML matrix is either all character or all numeric.
Ian.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Erwan
LE DU
Sent: 01 August 2008 09:07
To: SAS-L@LISTSERV.UGA.EDU
Subject: Debugging problem in proc IML
Hi all,
I have an issue with the following IML procedure.
I have a dataset test1 which is called from modMain by module modData.
I then call the modNC (module with argument) which is called from
modMain using the statement :
NCou=modNC(Country);
The issue is there : I get the following error message
(error) Matrix has not been set to a value.
However Country is a valid variable in the dataset test1.
I tried nesting modData and modNC within modMain without success.
Can someone help me on this?
Regards,
Ker
*
proc **iml*;
reset
noprint;
reset
log;
reset
flow;
reset
details;
start modData;
mydata=concat('use test',char(*1*,*1*),';');
call execute(mydata);
finish
modData;
start modNC(arg1);
read all var {arg1 N} into NC where (_type_='100');
return(NC);
finish modNC;
start modMain;
*run* modData;
NCou=modNC(Country);
print NCou;
finish modMain;*
run *modMain;
quit;
|