cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
mcmcleod1
Level I

importing SAS 9.4 custom formats to JMP 12 Pro

Hi,

     I have been working with a dataset in SAS 9.4 and I have created custom formats for some of the variable values. I then want to look at the dataset in JMP but regardless of how i move the dataset to JMP ( i.e., "view in JMP" through sas's explorer window, exporting via SAS code to .sas7bdat file type) I am not able to maintain variable custom formats. I have noticed that i do retain custom formats which appear to be created in SAS ver. 7|8 but not those created in SAS ver. 9.4.

     In JMP these custom formats are called "value scores".... where in SAS they are defined like:

proc format ;

     value employ_ 0 = "0 = Unemployed" 1 = "1 = Employed" 3 = "3 = Retire & Not Working"

     ;

run;

     I've been trying to setup a metadata server (which I'm not sure will resolve this problem) for my local machine but my firewall settings are locked down right now.

     Will the metadata server resolve this problem or should I be doing something else in order to get SAS to pass the formats to JMP?

Thanks,

5 REPLIES 5
Eric_Hill
Staff

Re: importing SAS 9.4 custom formats to JMP 12 Pro

Hey, mcmcleod1,

First and foremost, as you suspected, I don't think configuring a SAS metadata server is going to help you get SAS custom formats into JMP.  There are lots of good reasons to set up a SAS metadata server, primarily to enable access to SAS to lots of people, but your ability to get custom formats should be independent of that.

The best way I know of to get SAS custom formats into JMP (as value labels) is to use File > SAS > Browse Data from JMP.  This requires you to make a connection to local SAS or SAS running on a server somewhere.  You'll get an interface that looks like this:

12640_browse_sas_data.png

You can then select the library and data set that you want to import into JMP.  When you click Import, JMP will import the SAS data set, and if it sees that the data set contains user-defined formats, it will attempt to convert them to JMP value labels.  In order for that to work successfully, the user-defined formats need to be contained in a format catalog that SAS is configured to look for formats in, which may require you to have LIBNAME and FMTSEARCH statements in the autoexec.sas file that SAS uses when it starts up.  But, if the format information can be found, JMP will do its best to map the user-defined formats to value labels.

Let me know if you have success with this approach.

Thanks,

Eric

mcmcleod1
Level I

Re: importing SAS 9.4 custom formats to JMP 12 Pro

Thanks. That clears things up a little. However, every time I select Browse File > SAS > Browse Data I receive the JMP alert:

12742_pastedImage_0.png

After selecting "no" I can get to the browse data window but there are no datasets showing in the Work library. This is despite having SAS running concurrently with datasets visible in the work library from SAS's explorer window.

I have reviewed the documentation on setting up JMP to interface with SAS through the preferences window but it is not clear to me if there is some way to setup the link with SAS on my local machine.

Any idea if there is a setting to address this?

Thanks,

Jeff_Perkinson
Community Manager Community Manager

Re: importing SAS 9.4 custom formats to JMP 12 Pro

The first thing to know is that the SAS session you are running interactively is not the same SAS session that JMP is connecting to. Therefore they don't share a WORK library.

You'll want to copy the datasets to a permanent library and then make sure the libref is assigned in the SAS session that JMP is connected to. You can do that with File->SAS->New SAS Program. You'll get a SAS Program window and you can put your LIBNAME statement in there, then right click and choose Submit to SAS.

Then that library should show up in your Browse Data window and you'll be good to go.

Let us know how you make out.

-Jeff

-Jeff
teebahnson
Level III

Re: importing SAS 9.4 custom formats to JMP 12 Pro

My fix for this is to export from SAS to JMP using the following code:


PROC EXPORT DATA= (sas dataset with custom formats)
OUTFILE= "jmp_dataset with custom formats as value labels.jmp"
DBMS=JMP label REPLACE ;
RUN;

albest3
Level I

Re: importing SAS 9.4 custom formats to JMP 12 Pro

I too am trying to get a sas dataset with user-defined formats into a jmp datafile with value labels.

I've tried all of the options in this thread and none work. (I'm using SAS v9.4 and JMP pro v 15.2)

 

Even the simplest dataset doesnt come across correctly ... even when I use the browse sas data process in JMP. I welcome feedback on what I'm missing.

 

Libname library "C:\Users\albest\Desktop";
Proc Format library=Library;
Value $MF "M"="male" "F"="female";
Value highlow 100="one H" 200="two H";
Data Library.Test;
Input Sex $ age;
Format Sex $mf. ;
Format age highlow.;
Label Sex="Sex label";
Label Age="Age label";
Datalines;
M 1
M 100
F 2
F 200
Proc Contents;
Run;

PROC EXPORT DATA= Library.Test
OUTFILE= "C:\Users\albest\Desktop\test.jmp"
DBMS=JMP label REPLACE ;
RUN;