Hi,
I have existing code from older work from a previous user. This code is set up to path to files on my computer. These are in .AWC. format, specific to the accelerometer we use - the Actical.
The main issue is that SAS on demand or SAS viya for learners will not recognize my data for some reason. I can open the data as a test and see the variables and data, so it will not collect the values for some reason. The data is 2 columns, time and steps. This data has been analyzed properly before by a previous researcher, but we do not have contact with them. Plus, this was a much older version of SAS, and I cannot open our .egp Flow process on there, as it seems to not be capable with 4.3.
If you see the code, I have all my data in the "DATA" folder, ending with AWC. And the participants are coded as the following: PLA001T1 (withT1 to T3 possible), hence labelled as 8 for length.
I am also trying to export that data into xlsx (Excel), and this will not work. For clarity, I am using a Mac, but it should be fine as I am using the browser versions.
Although no data shows up in the spreadsheets, the code seems to be ok overall, but I also get this error at the end. This error comes up twice. From my searching, this is due to it making an error trying to export into excel.
ERROR: Server Name is invalid or missing.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
The entire code is attached for reference.
I am unsure if this makes any sense, but any help would be appreciated. I am a beginner, using existing code, as I was volunTOLD to do this by my supervisor lol.
Thank you in advance.
You need to specify a DBMS (database management system) in each of the PROC EXPORT steps in your code:
* for example - to export a dataset called STUFF to the outfile "&outxls": ;
proc export data=stuff dbms=xls REPLACE
outfile="&outxls";
sheet="&sheetname";
run;
REPLACE is optional - however, if you omit it and the file already exists, it's going to fail -- replace causes it to overwrite the existing file.
SHEET is also optional (note it's a separate statement -- has its own semicolon) - you can write multiple sheets to the same XLS / XLSX file by running proc export multiple times with different sheet names.
I'm not honestly sure that XLS is still valid. If this is still failing, I would highly recommend trying XLSX (change file names too) instead -- DBMS=XLSX
*
It needs to come before the first semicolon -- so like this:
proc export data = perday DBMS=XLS outfile = "&xls_path.";
run;
&XLS_PATH is a macro variable, meaning, when SAS runs this code, it will "interpret" this variable and replace it with the underlying text.
So somewhere in your code, you have a statement like this:
%let xlspath=/home/data/accelldata.xls;
You are storing the path and filename into a macro variable called xlspath. When you put an & in front of that (&xlspath) in your code, SAS will replace it with your path/filename (simply because that's the text you set it equal to).
Again, I don't know what other problems might be in your code. I'm not sure what you mean by you can't find your data. Do you mean the source data or the data you're trying to create with the program? You've looked through all the folders in SAS OnDemand?
So your adjustment worked in regard to creating the Excel export, which is great! Thanks! No more server error. But it just further highlights the issue with it reading my data. None of the data is being "loaded" in. This code was used in the same file format before, but the path was direct on the computer; the only difference is that it is being uploaded to the on-demand system. So something must be up with my path, directory or the files themselves. I should also be able to bulk run the participants, so idk what is happening. I cannot get a trial version to download to my computer as I have a mac. Even if I use another Pc, support told me I cannot get a trial if I am not a business.
Here is my directory.
A library was created for "DATA"
OK, here's what I suggest. With your mouse, highlight the entire portion of the program from the very top to just above (not including) the green 'comment' lines shown in the screenshot below. With that highlighted, hit the run button. Once it's done, go to the tab that shows the log. Tell us what you see. What's happening in that section is that it's trying to read all your .awc files (you will see them defined in the line that starts with "filename rawdata"). Below that is the first "DATA" step - it's pretty complicated looking, but basically it's reading in the .awc files that were defined with the handle "rawdata" and determining what looks like valid data and what doesn't. The valid stuff (if any) is going into a dataset that's for some reason just called "c". The rest are getting dumped into two other files. What you need to do is look at the log towards the bottom that should be reporting the results of this process. If it's successfully reading the 'rawdata' files, (i.e., no errors), it should tell you how many rows are getting output to each of the 3 datasets it's trying to create. Tell us what you see in this portion of the log.
Once again, thank you so much for the help. Since I find this all a bit confusing, I have attached my entire log output for simplicity (on my end). Sorry if this is too much to ask and you want me to pull something more specific out.
thanks
Really hard to say what's going on - from the log, it looks like it loaded one of the .awc files and read 12 records from it, but none of the 3 output datasets have any records in them. The output dataset called 'c' should have all the records but doesn't. I don't know why that would be the case. Maybe someone here who understands more about reading unusual data could help. I would recommend you reach out to these people (assuming that's not where you already work) for help:
https://impactslab.com/wp-content/uploads/2021/02/UserManual_BoudreauBelanger-V1-3-2.pdf
I think the program was written by someone that only used PC SAS.
It has comments in there that using filename wildcard of *.awc will match files that end with .awcm. Which is true on Windows, but not on UNIX.
It also is parsing the filename using only \ and period as delimiters. But on UNIX the filename will use / as the delimiter between directory levels.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.