Date: Tue, 16 Mar 2010 18:58:03 -0400
Reply-To: Jim Groeneveld <jim.1stat@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <jim.1stat@YAHOO.COM>
Subject: Re: symput parameters error
Hi Tom and Mark,
I think &Field1 in the CALL SYMPUT (or CALL SYMPUTX) statement should be put
between double quotes. I yet don't quite understand what Mark actually does.
With every iteration he overwrites the dataset Idde, ending up with only the
last instance. Maybe his problem is solved unnecessary complicated and there
may be a much more simple solution to it. Mark, can you elaborate on what
you actually want to do?
Regards - Jim.
Jim Groeneveld, Netherlands
Statistician, SAS consultant
On Tue, 16 Mar 2010 09:17:35 -0700, Tom Abernathy <tom.abernathy@GMAIL.COM>
>I see two places with strange syntax.
>1) Your quoting in this statement
> CALL SYMPUT('"VAR1"',&FIELD1);
> Should be simplified to :
> call symput('var1',&field1);
>2) You left off the () around the FIELD1 parameter value in your call
>to the SCANLOOP macro. Actually you ate them up by including the
>unneeded %STR macro funcation. Instead you should use:
>On Mar 16, 11:04 am, Mark Sussman <msuss...@gmail.com> wrote:
>> Hello all,
>> I'm getting a "null parameters for symput are invalid" error with my
>> code and was wondering if someone could help.
>> This is just a subset of my larger code that I was telling your method
>> on. Basically I'm using the variable sheet_name from the database
>> SHEET_NAME which is a string like this 'Allberry, Loretta Ann - 5025'
>> that will then be using to DDE a spreadsheet based on the results
>> created in PLAINTIFF. Below is my code:
>> %MACRO SCANLOOP(FIELD1);
>> data _null_;
>> if 0 then set sheet_name nobs=x;
>> call symput('RECCOUNT',X);
>> /* loop from one to number of */
>> /* records */
>> %DO I=1 %TO &RECCOUNT;
>> data _null_;
>> SET sheet_name (FIRSTOBS=&I);
>> CALL SYMPUT('"VAR1"',&FIELD1);
>> data plaintiff(drop=sheet_name);
>> set idde;
>> if sheet_name="&VAR1";
>> %MEND SCANLOOP;
>> /* Call SCANLOOP */
>> %SCANLOOP %str(sheet_name);