Good afternoon,
Somehow any time I download a sample sas file it is being saved in a folder as a .pdf file. How can I remove the pdf association for sas type files upon downloading them? . Thank you.
@JosvanderVelden wrote:
On windows you can always change it. There are multiple ways to change the default program that opens a sas7bdat-file (or any other extension). See for example: https://support.microsoft.com/en-us/windows/change-default-programs-in-windows-e5d82cad-17d1-c53b-35...
Back in the days of Windows 7, IIRC, I had one of our IT "experts" change some SAS file associations using Window tools. They never worked right again until I update to the next release of SAS. Just a warning.
And now I am not allowed to run the proper SAS program, SAS Deployment Manager and the Manage SAS files task because of security issues. I would have to have one of the IT people run it and tell them what to do...
What was the file extension before you downloaded it? Where did you download it from?
It is unlikely that you can change a pdf file to a "SAS file", although I'm not really sure what you mean by "SAS file" and it would help if you explained what you mean.
When I tried to download a SAS file named sample-1.sas7bdat , (this is what I meant by sas file)
which contains my school sample SAS file, upon downloading the file from my university it shows pdf file.
The association for this .sas file type somehow by mistake was changed to .pdf, but I am, unable to remove the file type of .pdf back to .sas file.
Now since the systems sees it as a .pdf file , I am unable to open it in SAS program.
Thank you for your help
@ykassoo wrote:
Now since the systems sees it as a .pdf file , I am unable to open it in SAS program.
I do not agree with this. You should be able to open it in SAS with the proper SAS commands in a short SAS program. What happens when you try to open it in SAS via a SAS program? Please provide details about how you try to open it in SAS via a SAS program, and what happened/what error messages did you get?
You normally do not "open" a SAS dataset.
Instead you just USE it.
If you downloaded the SAS dataset to a file named 'sample_1.sas7bdat' and stored it in a directory on the machine where SAS is running then just make a libref that points to that directory.
So if you are running SAS on your PC and you put the file into c:\downloads then the code would look something like:
libname dl 'c:\downloads';
proc contents data=dl.sample_1 ;
run;
If the filename is not a valid SAS member name, like your example with the hyphen in the name, then you probably do not actually have a SAS dataset.
But you could try renaming it and see if it works.
So change the hyphen or any other strange character to underscore. Also make sure all of the letters in the filename are lowercase (just in case you are running SAS on a Unix machine).
What happens, if you double-click the file? Can it be displayed properly by Acrobat Reader?
Please note, that there is a huge difference between the file extensions sas7bat and sas. The first contain data, the later code.
Someone (or something) changed the association in Windows to "Acrobat Reader", but the file is still a .sas7bdat SAS dataset file (no pdf here in any way).
Anywhere where you have a SAS installation, you can use this in the usual way (assign a LIBNAME in code and use it). Don't bother what Windows Explorer thinks.
You can change the association in Windows Explorer if you have a suitable application (Base SAS or SAS Universal Viewer) installed.
@JosvanderVelden wrote:
On windows you can always change it. There are multiple ways to change the default program that opens a sas7bdat-file (or any other extension). See for example: https://support.microsoft.com/en-us/windows/change-default-programs-in-windows-e5d82cad-17d1-c53b-35...
Back in the days of Windows 7, IIRC, I had one of our IT "experts" change some SAS file associations using Window tools. They never worked right again until I update to the next release of SAS. Just a warning.
And now I am not allowed to run the proper SAS program, SAS Deployment Manager and the Manage SAS files task because of security issues. I would have to have one of the IT people run it and tell them what to do...
Thanks for the response. I had to change the association to notepad, since SAS is not on my C: drive.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.