Subscribe Bookmark RSS Feed

SAS datasets "Open With" JMP

ig

Community Trekker

Joined:

Jun 23, 2011

Hi,

I am new to JMP and would like to use it with SAS datasets on Windows XP.

Is it possible to set the “use SAS variable names as column headers” option globally in JMP, so it will be invoked even when a SAS dataset is being open by clicking on “Open with” in Windows Explorer?

Thank you for advance.
IG
5 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

I am not seeing a way to directly do what you ask though it may be possible and someone here may show you the way. However, it is possible through scripting to change the column headers of the imported table to the equivalent SAS variable names. When you open a SAS dataset in JMP, JMP appears to create 2 new properties for each column. One is called SAS Name and the other is called SAS Label. You want to replace the JMP column names with the SAS Names. Here is a script to do that (at least in 8.0.1):

dt = Data Table( "DemoSAS" );
lastcol = N Col( dt );

For( i = 1, i < lastcol+1, i++,
col = Column Name( i );
SASn = col << Get Property( "SAS Name" );
col << Set Name( Char( Eval Expr( SASn ) ) );
);

You would need to change the first line as appropriate ... e.g. you can replace "DemoSAS" with the name of an open table, or you can change the line to be an Open which will prompt you to select a file containing a JMP table.

I haven't tried it but it is possible (not certain!) you could create a new file association which you could label Open SAS Data with JMP that runs a similar script on opening a SAS dataset.

Michael
gh

Community Trekker

Joined:

Jun 23, 2011

in version 8.0.1 go to File / Preferences (or ctl-K) and scroll down to SAS Integration. There are 3 options for SAS Import:
- Use SAS Column Labels for Column Names during data import
- Convert SAS custom formats to JMP value Labels
- Warn before closing unsaved imported data
ig

Community Trekker

Joined:

Jun 23, 2011

Hi Michael and GH,

Thank you for your replays.

I am trying to convince our non-programming users to use JMP instead of SAS Viewer or MS Excel. Since we have SAS datasets in multiple locations it is more convenient to use the MS Windows Explorer ‘Open With’ feature:
Navigate to the appropriate directory in MS Win Explorer, right click on a SAS dataset, point to ‘Open With’, and click on JMP Application to open the dataset in JMP.
Unfortunately JMP gives variable labels instead of variable names as column headers. I did not find any way to switch to variable names. Of course, the first i tried was ‘SAS integration’ options in JMP Preferences. It works only if a SAS dataset is open directly from JMP but this option is getting lost if a dataset is open with JMP from MS Win Explorer. It might be a JMP installation problem or a JMP bug: if there is an option it should work no matter how JMP gets executed.
A solution with a script might work:
How to integrate a script into JMP so it will be invoked when JMP is getting executed from Win Explorer thru the “Open With” feature?
For the time being I have written a SAS macro to export all SAS datasets of interest to an Excel file as separate sheets and with variable names as headers.

Thank you again for your help,
IG
mpb

Super User

Joined:

Jun 23, 2011

It might be worth checking with SAS support about getting Open With to do what you want. It also is worth letting SAS support know that you would like JMP to have the capability built in to Open With JMP using SAS names instead of SAS labels.

A possible half way workaround would be to add a script like the one I suggested to the menu bar of your users JMP installation. Then, when they open a SAS dataset using Open With, they would just have to run the Menu item script to change the headers. This can be done and the process of doing such a customization to a single installation of JMP is described in the JMP docs.

Michael
ig

Community Trekker

Joined:

Jun 23, 2011

Hi Michael,

Thank you very much. I will definitely contact SAS support and post any valuable information received from them to this thread. By the way, the SAS itself has a similar nuisance: I have permanently changed the VIEWTABLE to display variable names as default ( see http://www2.sas.com/proceedings/sugi31/255-31.pdf), but the labels are still coming on ‘Open With SAS’. At least there is a View option to switch to variable names. Your script provides such an option in JMP.

Thanks again.
Have a nice weekend.

IG