DATA Step, Macro, Functions and more

9.4 defaulting columns to name view not label view

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 128
Accepted Solution

9.4 defaulting columns to name view not label view

Hi,

 

So when i was in 9.2, i had set up my settings so that everytime i opened a table it would default to the names of the columns, not the labels.

 

Now that we've upgraded to 9.4, i read that that process is different in 9.4.  Supposedly, if you just change it once (view --> column names), then that setting should stay for everything after that.

 

Mine isn't doing that.  Sometimes it does, sometimes it doesn't, sometimes within the same session some tables open with names, some open with labels, some sessions open tables with names every time.  I can go 3 days and have everything open with names and then, boom, labels.  And i don't know how to make this consistent!!!

 

I want to default my 9.4 settings to ALWAYS open with column names, never column labels.

 

Thanks

Megan


Accepted Solutions
Solution
‎04-14-2017 08:41 AM
Super User
Super User
Posts: 6,500

Re: 9.4 defaulting columns to name view not label view

It looks like in SAS 94. the COLHEADING= option on the VIEWTABLE command is broken.  But the COLNAMES and COLLABELS commands still work once VIEWTABLE is actually running.  So that is why I made the modification to the command that you wnat Explorer to use when opening a dataset. The semicolon ends the VIEWTABLE command then the COLNAMES command is run after ViEWTABLE has started.

View solution in original post


All Replies
Contributor
Posts: 71

Re: 9.4 defaulting columns to name view not label view

[ Edited ]

Hi MeganE,

 

I'm assuming that you are using SAS Display Manager (also known as "Base SAS" to some) rather than SAS Enterprise Guide and that you are using the VIEWTABLE tool to browse or edit your datasets, it looks a bit like this:

SAS VIEWTABLE 2017-04-13A.JPG.

This link shows you the spiffy new SAS 9.4 documentation about setting VIEWTABLE options:

SAS® 9.4 Programming Documentation SAS Language Reference: Concepts

In that article there are two methods mentioned, one, nice and easy, is to open a dataset in VIEWTABLE and then click on the View menu. Choose between the Column Labels and Column Names entries, as you wish. If you choose Column Names, your VIEWTABLE should show only column names, and not any assigned labels.

 

SAS VIEWTABLE 2017-04-13B.JPG

 

I am using SAS9.4M1 and have found that once I chose View->Column Names the VIEWTABLE responded correctly. Then, to test the persistance of the setting, I quit that SAS session and and re-started a new one. in that second and any subsequent SAS sesison VIEWTABLE remembered the setting that I had made when the first SAS session ended.

 

If you are not seeing this behaviour:

1) Check that you have only ONE SAS session open and only one VIEWTABLE window open at the time you make the preference choice from the View->Column Name choice.

2) Ensure that you are using SAS 9.4M1 or higher (click on Help->About SAS 9)

 

If you have checked the above two things and your choice of View->Column Names is still not being persistent for VIEWTABLE sessions you should consult your site SAS software representative or failing that SAS Technical Support in your country.

 

If you are using a release of 9.4 that is prior to 9.4M1, there may be an alternative to try if the above does not work. In that case, reply to this posting indicating so. Also, please indicate if the same dataset behaves differently in different sessions. If you can make it work/not work with a commonly available dataset like SASHELP.AIR, that would be very helpful to try to pin down any problem's cause.

 

Best of luck,

 

Downunder Dave.

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

Thanks!  We're using 9.4 TS Level 1M4, and View --> column names is what i did.  The one part of your response that sounds promising is having more than one table open at a time (within the same session).  Because i've seen that - names on one, labels on another.

 

And i have talked to support@sas.com, but of course every time they're like, "What's it look like now?" it looks right, so they can't help!!  Ugh!  Smiley Happy

 

So i just tested it again.  First table i opened was fine.  2nd, 3rd (while keeping the others open as well), all fine.  I can't get it to happen again.  Of course...

 

I'll take a screenshot next time.  Maybe that'll kick a reason loose.

 

Thanks!

Super User
Super User
Posts: 6,500

Re: 9.4 defaulting columns to name view not label view

Make sure you are not running multiple SAS sessions at once.  This can impact the ability to modify settings that SAS stores in the SASUSER library.

 

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

I can pretty confidently rule that one out.  I only do that rarely.  Thanks!  In fact, not sure i have done it at all since we switched over.

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

It just happened and i got a screenshot.  I've been in this session for over an hour.  Every table i've opened has been names and now this one is labels.  As you can see from the screenshot it's the only one open at the time.

 

 

 

 


sas labels.png
Super User
Super User
Posts: 6,500

Re: 9.4 defaulting columns to name view not label view

Is it possible that SAS has remembered that table name in some way and saved a preference to open with LABEL view instead of NAME view?

How did you open it? View command?  What command?

Mouse click?  Is it possible your mouse slipped and clicked on a different command than you aimed for?  That happens to me all of the time and one reason I prefer to use commands or function keys.

 

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

I have no idea what SAS could be remembering.  But these tables are only just being created.  They didn't exist a few minutes ago.

 

And the only way i ever open sas datasets is by clicking on them in SAS explorer.  Here's one that just happened right now.  It's a different session than the previous one because i had to shut it down.

 

sas labels2.png

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

Ok, some new information has come to light.  Since i don't use labels all that often, i don't notice when it's labels instead of names.  I just followed some code through that picks up a label from another table and when i open *that* table, then it displays as labels, not names.

 

Could that have something to do with it?

 

So in this new table, that has 3 labels, it displayed with labels.  I changed it BACK to names.  Closed sas, reopened it, assigned the libname, and it's now opening as names.

 

Do i have do this for EVERY single table that i create that happens to have a label?!?!?!?

Super User
Super User
Posts: 6,500

Re: 9.4 defaulting columns to name view not label view

[ Edited ]

There is a SUGI paper on VIEWTABLE that explains exactly how to change the action that takes when you "open" a dataset from the SAS explorer window.  Basically it shows how to add the COLHEADING=NAME option to the VIEWTABLE command that explorer generates.

 

http://www2.sas.com/proceedings/sugi31/255-31.pdf

 

See page 11.

 

I tried that method and it did not work exactly as the paper said when using SAS 9.4.  But it is easy to modify.  So open the file using VIEWTABLE and then issue the COLNAMES (or COLLABELS) command when running viewtable.  So the line that you want the OPEN command to run so that it always shows the NAMES is:

 

VIEWTABLE %8b."%s".DATA ; colnames
Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

[ Edited ]

Thanks.  This is the way i did it in 9.2, but was told it didn't work for 9.4.  Or wasn't needed or something.

 

Actually, in 9.2 it's colheading=names.  I tried what you wrote and i got beeped at everytime i opened a table and all labels are showing now, lol.  So i did colheading=names instead and that seems to be the way to go.

 

I did notice however, that when sorting an open table, (not in edit mode, so a new table has to be created,) the labels will pop up.  But i'm ok with this.  It doesn't happen on proc sort, so it's not the same since open and column sort is temporary.

 

Thanks

Solution
‎04-14-2017 08:41 AM
Super User
Super User
Posts: 6,500

Re: 9.4 defaulting columns to name view not label view

It looks like in SAS 94. the COLHEADING= option on the VIEWTABLE command is broken.  But the COLNAMES and COLLABELS commands still work once VIEWTABLE is actually running.  So that is why I made the modification to the command that you wnat Explorer to use when opening a dataset. The semicolon ends the VIEWTABLE command then the COLNAMES command is run after ViEWTABLE has started.

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

Ok, i just removed colheading=names to try colnames *after* a semi colon, and i'm no longer getting beeped at.  Still get labels on a manual open table sort, but at least i'm not getting beeped at.  And if i close the new table and re-open it, it's back to names.

 

Thanks!

Trusted Advisor
Posts: 1,614

Re: 9.4 defaulting columns to name view not label view

[ Edited ]

I believe that these instructions permanently set Viewtable to show the column names

 

http://stackoverflow.com/questions/19527950/how-to-setting-viewtable-to-show-column-names-in-sas

Frequent Contributor
Posts: 128

Re: 9.4 defaulting columns to name view not label view

Thanks.  That's referring to an earlier version of SAS, but i did do it for 9.4 just this morning, so we'll see it works with this version too.  I had been told by sas that it didn't, so we'll see.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 15 replies
  • 322 views
  • 0 likes
  • 4 in conversation