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 EntryUnfortunately, 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: %inc fref;) and save the file.
2 - Export the CatalogThe 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:temptrans.exp' memtype=catalog;
RUN;The above file then needs to be manually (or otherwise) transferred to a location that the new environment can read from.
3 - Import the CatalogCan 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";
RUN;We now have our catalog available to use in the correct (binary) format.
4 - Run some SCLThe 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;
put "excecuted " scrn= path=;
proc build batch c=sasuser.batchaf;
proc display c=sasuser.batchaf.builder.scl;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).