BI Tools

Tips and tricks for building information maps, OLAP cubes, reports, and dashboards

BI Admin

Learn your way around a SAS BI installation.

Visual Analytics

Learn your way around the SAS Visual Analytics tool

Coding & Data

Extract, transform, and load your data into the SAS BI toolset

Stored Processes

Create and design stored processes like a rock star

Home » BI Admin, Visual Analytics

4 Tips for Using Linux to Find SAS VA Logs

Submitted by on 2014-10-28 – 12:10 PM 4 Comments
Charleston Cemetery - Matthew Brady

Charleston Cemetery – Matthew Brady

In the US, Halloween is celebrated by young children dressing up as ghouls, ghosts, and demons of other sorts.  I think the original idea of costumes was to be the scarier demon, which means if I look like a bad ass demon then maybe the truly bad ass demons will run away in fright. This made me wonder What do I truly find scary? Turns out it is not graveyards, ghosts, or even vampires – no it’s operating system command lines.

DOS is Spooky, Linux is Just Scary

You can’t really use a computer without suffering through the operating system. For most of my early career this meant working with command line interfaces.  You have to be incredibly accurate to work on a command line and know the exact name of everything. One mistyped date or filename and months of work could disappear before your eyes – now that is really scary because you could also delete other people’s hard labor as well.

I remember my first time using an Apple Macintosh.  My professor’s first comment was “Look you can just drag and drop files.  If you make a mistake just pull it out of the Trashcan.”  Yes – it was wonderful.  It was amazing to me that any command line operating system would survive.  Why didn’t the masses of folks rise up in protest?  “We want our Recycle Bins!” and “Steve Jobs wants your head demons!”

SAS Visual Analytics is Routinely Installed on Linux

One way to rid yourself of demons is to call a priest who can perform an exorcism. Apparently command line operating systems are immune to even the most potent of holy men and persist in organizations. It seems like every other project I’m on requires Linux savviness. My original problem is that I really only know the very basics. I admit I only learned enough to get the job done. However many more customers are installing SAS Visual Analytics on Linux, so it is pushing me to learn more as well. Since these demons aren’t going anywhere – how do I collect my own bad ass demons to help make the task less scary and op sys more usable.

Tip 1: Create an Alias to be More Scary

Many users find working with the command line gives them more flexibility and power.  One thing I like about Windows is the ability to put a shortcut on the desktop – this way I don’t have to remember where the subdirectory that has the logs is located and one quick click takes me there. In Linux, there is a similar concept called alias. Basically an alias allows you to store a shortcut.  For instance, if I want to start the SAS Management Console then I would something similar to this:

scary_alias_01

I’m using MobaXterm Professional to manage my Linux connections and interface.  It’s another change that has made working with Linux more tolerable. However, I can setup an alias allowing me to type “sasmc” which does the same thing. This is because I set it up as alias.  This is something I would keep in my Evernote SAS notebook so I could use it between projects.

scary_alias_02

Tip 2: Use an alias for SAS VA log files

This turned into a really handy trick for me as I added some other aliases for sub-directories that I use a lot but again can’t always remember the names.  For instance, the log files for the various SAS VA Components. What I really appreciated is that setting up the alias was not that difficult. Here’s the steps I used to create an alias. If you have difficulty using these steps then speak to your system administrator. [Here’s a reference page for more information: The alias Command  and Unix Bash Alias Tutorial.]

  1. Edit thebashrc file using your favorite editor.  I use NANO instead of VI.
    > nano ~/.bashrc
  2. Add the shortcut to the file.  The syntax is alias shortcut-you-want-to-type = “full command you want to issue” For instance, since I learned to use DOS first, I frequently type DOS commands when I mean to use Linux.  In DOS, to modify a file you type edit.  For Linux I am supposed to type nano. This alias compensates for my trained fingers!
    # .bashrc
    # Source global definitions
    if [ -f /etc/bashrc ]; then
     . /etc/bashrc
    fi
    # User specific aliases and functions
    alias sasmc='/sas/SASManagementConsole/9.4/sasmc &'
    alias edit='nano'
  3. Save the file and restart your session.  You can type alias at the command line to see the available aliases (as shown above).
  4. Now, when you type edit  the system quietly inserts nano and its just like holy water was applied!

Most of the aliases I have added are to quickly access the SAS VA log directories.  Your system paths may vary but it would be similar to this.

alias valog1 ='cd /sas_install/Lev1/Web/Logs/SASServer1_1'
alias valog12 = 'cd /sas_install/Lev1/Web/Logs/SASServer12_1'
alias slog = '/sas_install/Lev1/Web/WebServer/logs'

Tip 3: Quick Way to See Logs

It is helpful to see the last log updated in the directory, so I added this command to see a long list sorted by time :

alias lst = 'ls -dt'

But then I thought it would be really cool if it would just show me the last 25 lines added to the last file updated in the directory. Tweak the 25 below if you want to see more lines.  [Reference: Tail last file in directory]

alias tlst = 'tail -n25 "`ls -t | head -1`"

Tip 4: Find An Alias Used by Others

These are just some ideas to help speed things along for you.  Here’s some examples of alias files I have collected from around the web. There are some cool ideas and some that must be specific to that user’s personal issues.

If you are already have an optimized, efficient bashrc file suitable for SAS environments … what kind of spells do you use?

The following two tabs change content below.

Tricia Aanderud

Director of Data Visualization at Zencos Consulting
Tricia Aanderud is a SAS Business Intelligence and Visual Analytics consultant based in Raleigh, NC who works for Zencos Consulting. She has written several books about SAS, presented papers at many SAS conferences, and has been using SAS since 2001. Contact her for assistance with your next project.

Tags: ,

4 Comments »

  • Tricia says:

    Oh no! I’m always amazed at people who can take in so much knowledge at such a depth.
    You are one of the smartest people I know in this field – keep up the good work.

  • Jaap Karman says:

    Tricia, I often feeling in mastering a lot but seen as a jackass :-((
    It is a result of digging in areas other people are seeing as their territory.
    Part of life of the analytics BI data science (whatever named).

  • Tricia says:

    Jaap
    Thanks for commenting and adding such good information.

    I agree some of it is an attitude – but some of it is just being pulled in so many directions. I often feel like “Jack of all trades, Master of none”. 🙁

    I’m hoping to become more of an expert but the alias trick has already saved me a lot of typing and me more effective. I am going to try writing a script here soon!

    Tricia

  • Jaap Karman says:

    Tricia,
    The demons for the OS usage and the commandline are an attitude. They are not that scary and spooky when you get used to them. The arguments (functionality) you have already mentioned.

    I would not use the alias approach on unix/Linux it is more like building your scripts/batchfiles. Yes the path-statement also exists on unix.
    An more easy way would be defining logical links. Defining that in a standard way (scripted) can life make easy http://en.wikipedia.org/wiki/Symbolic_link
    Your homedir (My documents) is also there, it is easy found as cd ~. These are usable by all tools going by that definition/location.

    As with Windows there is a rather standardize way to set up all names and deploying tools to locations. see: http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/fhs.html

    I was thinking first your post would be on topic with Windows-services, Mainframe SVC’s Unix daemons. http://en.wikipedia.org/wiki/Daemon_(computing) That is a very spooky and scary area.

    What are the relations with SAS?
    – Those daemons are the heart of a BI/DI server and grid environment. It is filled with al lot of them
    – That homedir (~) usage and more of Linux is a little bit problematic with SAS. Those common Linux/Unix standards are often failures by what SAS thinking to do.
    On those area-s there is a lot of hard work to do.