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.
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 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:\temp\trans.exp' memtype=catalog;
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";
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;