01-13-2014 06:28 PM
Is that possible to display both column names and labels? I have a sas file that has both, but for some reason I can't get JMP11 display (or export) both labels and names in the first row.
01-13-2014 10:03 PM
You posted this, again, on the main discussion board. You first have to click on the link for the JMP forum then, once there, post your question.
While I'm not familiar with JMP, my guess is that it is either using, or using something like, SAS's viewtable.
If so, it can only show EITHER variable names, or variable labels, but not both. If it is using the SAS/AF viewtable command, there should be a way to toggle between the two choices.
01-14-2014 11:35 AM
First - I apologize for posting twice in the wrong forum! Second - the solution, it seems, is to use an add-in (found here:Switch
to short or long names) and then export two tables, one with short names and then one with long names. I can then do the name merging in Excel. My goal was to get the column names look like : "SAS Label (SAS Name)". Very lengthy solution, but I haven't found a better one yet.
01-14-2014 09:09 PM
Since that was John's suggestion and he is THE John in John's Macintosh Program (i.e., JMP), I'd think you might have already found a good solution. If you also license SAS you could, of course, create a 2nd file that combines the variable names and labels into the label, exactly as you want them, and then only view the labels as headers.
01-15-2014 04:03 AM
If you do have access to SAS you can create the combined labels before you import to JMP.
Data have ;
Length id 8
Label id = "Identifier"
Prod = "Product Name"
PP = "Purchase Price"
/* No data in table but not needed for this demo */
Proc SQL ;
Select CATX (" ", Name, "=", QUOTE (CATT (label, ' (', Name, ')')))
separated by " "
Where Libname = 'WORK'
and Memname = 'HAVE'
/* Must use caps */
Data want ;
Set have ;
Label &NewLabels ;
[tested code - SAS EG with version 9.3 on the server]
This solution saves the code for the new labels in a macro variable. It should work for at least 200 variables, even if both variable names and labels are of maximum length. You can check whether the length of the macro variable is at risk of running into the limit using
%Put %Length (&NewLabels) ;
- any value near 65534 should raise alarms.
Having said that I do not know what the limit is for the length of a column name in JMP but I suspect it is less than the 254 characters allowed for a label in SAS 9.3 so some truncation may occur.
Richard in NZ