LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2010, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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 http://jim.groeneveld.eu.tf

On Tue, 16 Mar 2010 09:17:35 -0700, Tom Abernathy <tom.abernathy@GMAIL.COM> wrote:

>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: > %scanloop(sheet_name); > > > >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); >> Stop; >> run; >> >> /* loop from one to number of */ >> /* records */ >> %DO I=1 %TO &RECCOUNT; >> data _null_; >> SET sheet_name (FIRSTOBS=&I); >> CALL SYMPUT('"VAR1"',&FIELD1); >> stop; >> run; >> >> data plaintiff(drop=sheet_name); >> set idde; >> if sheet_name="&VAR1"; >> run; >> >> %END; >> %MEND SCANLOOP; >> /* Call SCANLOOP */ >> %SCANLOOP %str(sheet_name); >> RUN;


Back to: Top of message | Previous page | Main SAS-L page