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 (April 2008, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 29 Apr 2008 17:04:19 -0500
Reply-To:   Mary <mlhoward@avalon.net>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Mary <mlhoward@AVALON.NET>
Subject:   Re: SAS code works on laptop but not on workstation
Comments:   To: Cristian Gugiu <crisgugiu@yahoo.com>
Content-Type:   text/plain; charset="iso-8859-1"

I think the Sysfunc seems to be case sensitive: you've got:

%if %sysfunc(exist(Loc.Lambdas))=1 %then %do;

but your file is loc.Lamdas. Try this (I've uppercased the libname Loc. ).

%MACRO AppendData;

%if %sysfunc(exist(work.Lambdas))=1 %then %do;

%if %sysfunc(exist(Loc.Lambdas))=1 %then %do;

data Loc.Lambdas;

set Loc.Lambdas work.Lambdas;

run;

%end;

%else %do;

data Loc.Lambdas;

set work.Lambdas;

run;

%end;

proc datasets ;

delete Lambdas;

run;

%end;

%else %put Temporary file Lambdas does not exist in the Work folder.;

%Mend;

-Mary

----- Original Message ----- From: Cristian Gugiu To: Mary ; P. Cristian Gugiu ; SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, April 29, 2008 3:51 PM Subject: Re: Re: SAS code works on laptop but not on workstation

Mary,

It doesn't quite fix the problem. The first two times I ran the code, it worked perfectly. Loc.Lambdas had 56 records. The third time I ran the code, the SAS session closed unexpectedly as before. When I checked the permanent dataset, there were less than 56 records. I restarted my computer and ran the code again, this time there were only 52 records. I ran it again and SAS shut down again. I reran it again, there were 54 records. Reran it again, there were 55 records. I ran it again, I had 56 records. Just in case there was an incrementing pattern, I ran it again. Now, I'm back down to 55 records. I'm not making any changes to the code, so why do I get a different number of records each time? I make sure to delete the permanent dataset before each run. When I run the same code on my laptop I get 56 records each and everytime. Anyone know what's going on?

Here is the code that I used per your suggestion.

%MACRO AppendData;

%if %sysfunc(exist(work.Lambdas))=1 %then %do;

%if %sysfunc(exist(Loc.Lambdas))=1 %then %do;

data loc.Lambdas;

set loc.Lambdas work.Lambdas;

run;

%end;

%else %do;

data loc.Lambdas;

set work.Lambdas;

run;

%end;

proc datasets ;

delete Lambdas;

run;

%end;

%else %put Temporary file Lambdas does not exist in the Work folder.;

%Mend;

----- Original Message ---- From: Mary <mlhoward@avalon.net> To: P. Cristian Gugiu <crisgugiu@YAHOO.COM>; SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, April 29, 2008 3:54:38 PM Subject: Re: Re: SAS code works on laptop but not on workstation

Cristian,

It doesn't sound like there's too many records there- maybe try to see if you could substitute this code for your proc append and see if it works (or at least gives you a better error message)

data loc.lamdas; set loc.lamdas work.lamdas; run;

-Mary ----- Original Message ----- From: P. Cristian Gugiu To: SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, April 29, 2008 2:43 PM Subject: Re: SAS code works on laptop but not on workstation

Thanks to one members running SAS in a Vista OS environment, I was able to examine the log from his run. According to the log, there were 56 temporary datasets created with 1 record and 8 variables. Search for: "NOTE: The data set WORK.LAMBDAS has 1 observations and 8 variables." However, the final dataset located in the Loc folder is empty. Therefore, for some reason, either the following code does not appear to work in a Vista environment or something is preventing the temp dataset from being appended. Anyone have any ideas what might be going on?

%MACRO AppendData; %if %sysfunc(exist(work.Lambdas))=1 %then %do ; /* Appends results of each run to _Data. */ Proc Append Base=Loc.Lambdas Data = Lambdas ; run ;

proc datasets ; delete Lambdas; run; %end; %else %put Temporary file Lambdas does not exist in the Work folder.; %Mend;


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