Friday, 19 May 2017

Create / Compile / Run SCL in Enterprise Guide

The conundrum - I needed to run SCL on a windows machine without Base SAS (only EG) connecting to a Linux backend.

The obstacle - it is not possible to programmatically create an SCL catalog entry in batch mode.

The solution - read on!

Thankfully I did have access to a windows machine with Base SAS.  Taking inspiration from this post (thanks Robin) the steps were as below.  If you do not need to switch environments / operating systems, you can skip steps 2 and 3.

1 - Create an SCL Entry

Unfortunately, it is absolutely necessary to create an SCL file manually.  The good news is that you can do this just once, and write an entry that will simply %include any future SCL you send to it.  To create this file and corresponding catalog at the same time, use the build command:
This should open a window with the SCL entry.  Now add a single line of code (%inc fref;) and save the file.

What just happened?  We created an SCL entry in a catalog, which will run an %include statement from a fileref (fref) once compiled.

2 - Export the Catalog 

The catalog we created in step one (with one SCL entry and one line of code) now needs to be 'ported' to a transferrable format.  See CPORT:

PROC CPORT LIBRARY=sasuser FILE='C:\temp\trans.exp' memtype=catalog;
      select batchaf; 

The above file then needs to be manually (or otherwise) transferred to a location that the new environment can read from.

3 - Import the Catalog 

Can use EG for this!  In my case I also needed to remove the 'read only' attribute from the sasuser library.

libname sasuser "%sysfunc(pathname(sasuser))";
PROC CIMPORT LIBRARY=sasuser INFILE="/your/landing/area/trans.exp"

We now have our catalog available to use in the correct (binary) format.

4 - Run some SCL

The part we've been waiting for!  The steps here are to create our SCL (in fref), compile it and finally to run it (via proc display).

filename fref temp;
data _null_;
file fref;
input ;
put _infile_;
  put "excecuted " scrn= path=;
proc build batch c=sasuser.batchaf;
  compile select=builder.scl;

proc display c=sasuser.batchaf.builder.scl;run;

Of course this whole post is only relevant to you if you have SAS/AF installed on your server (check proc setinit for a ---SAS/AF entry).


Tuesday, 16 May 2017


The following came up when trying to launch sas on a recent Centos 7.3 install:

        MODULE: sasmotifsasvsub h.
                                   SUBSYSTEM: 8 SLOT: 11

/sas94/SASFoundation/9.4/sasexe/sas(+0x703ea) [0x7fb406fc43ea]
/sas94/SASFoundation/9.4/sasexe/sas(+0x70595) [0x7fb406fc4595]
/sas94/SASFoundation/9.4/sasexe/sasxfs(yustrt+0x265) [0x7fb3ea18c535]
/sas94/SASFoundation/9.4/sasexe/sasxfs(yuinit+0x1cb) [0x7fb3ea187a9b]
/sas94/SASFoundation/9.4/sasexe/sasxfs(yuropen+0x5ea) [0x7fb3ea18cfda]
/sas94/SASFoundation/9.4/dbcs/sasexe/saszu(xexprst+0x324) [0x7fb3e9756ea4]
/sas94/SASFoundation/9.4/sasexe/sas(vvtentr+0x13d) [0x7fb406fa06ad]
/lib64/ [0x7fb406b1ddc5]
/lib64/ [0x7fb40610f73d]

ERROR: Could not load /sas94/SASFoundation/9.4/dbcs/sasexe/sasmotif (38 images loaded)
ERROR: cannot open shared object file: No such file or directory

The clue was in the log, and the following command fixed it:

sudo yum install libpng12

Friday, 12 May 2017

SAS L is StiLL aLive

If you've ever done any moderate googling on a SAS topic you've probably unearthed a thread on SAS-L, quite possibly from several decades ago.  You'd be forgiven for assuming that this simply something that "used to exist' because - up until recently - that's exactly what I thought too.

Well - how wrong I was.  SAS-L is still alive and kicking.  The "L" stands for listserv, and is a mail server run by the University of Georgia.  It's basically a spamming service for SAS issues (am sure there is a better word for it though).

Getting started is as easy as 1,2,3:

1 - Sign up to the listserv service:
2 - Verify your email
3 - Subscribe to SAS-L  mailing list:

There is a ton of information on SAS-L on sasCommunity, and even a dedicated sugi paper.  So get involved - and you could be the next Rookie of the Year!