Hi all,
I'm new to SAS, while I was able to realize the results I want, I found my SAS is running "inefficiently".
So for example, I'm trying to get rid of parenthesis and any text inside the parenthesis of a variable (com_up). The new variable is called com_par.
The number of observations are around 19700000, which is a lot I think so should take some time. But today I wait for more than half and hour and the code is still running. I checked my task manager, it says SAS is using only 0.1% CPU.
The file is on my google drive but I synchronize it to my local computer. I have 128 gb ram. The code I use is as follows:
data new_db; set old_db; com_par = prxchange('s/\(([^\)]+)\)//i',-1,com_up); run;
I was wondering does this means SAS is not actually working? And is there any solutions on this?
Running SAS programs accessing remotely-stored data is nearly always slower than local data. I suggest you copy your data to a local drive and do a test run on that source, then compare SAS log run times.
You may have submitted only a part of the code (e.g. without the RUN statement).
What do you see in the log?
I saw the copy of the code in black. I also saw this before and when it finished running there will be blue lines showing me the running time and number of observations. So I think I submit the whole code, but it is really weird in the task manager, only 0.1% CPU used before the result comes out.
Please examine your code carefully. There is a semi-colon missing.
Hi, yes you are right, it is a typo when I post the question. The code has semicolon.
@Eileen1496 wrote:
Hi all,
I'm new to SAS, while I was able to realize the results I want, I found my SAS is running "inefficiently".
So for example, I'm trying to get rid of parenthesis and any text inside the parenthesis of a variable (com_up). The new variable is called com_par.
The number of observations are around 19700000, which is a lot I think so should take some time. But today I wait for more than half and hour and the code is still running. I checked my task manager, it says SAS is using only 0.1% CPU.
The file is on my google drive but I synchronize it to my local computer. I have 128 gb ram. The code I use is as follows:
data new_db; set old_db; com_par = prxchange('s/\(([^\)]+)\)//i',-1,com_up) run;I was wondering does this means SAS is not actually working? And is there any solutions on this?
I wonder if your "synchronize" means that every time you modify a record on your "synchronized" data set that something is trying to send that change back to the Google Drive. And that link may not be very efficient.
What do your system diagnostics say about network usage? and anything related to Google?
Yes I think I mean that. Because everytime I change anything, I can see google drive is synchronizing the change. By network usage do you mean internet? It is good. I don't think before I finish running this block of code, thus generating the new dataset, drive will synchronize. I used to suspect some of the time is used to download the file from google drive, but I tried all my files, even they are very large, when I click them they open immediately, so I rule out this factor.
Running SAS programs accessing remotely-stored data is nearly always slower than local data. I suggest you copy your data to a local drive and do a test run on that source, then compare SAS log run times.
I put them completely in a local drive, and it is way faster!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: