You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found that when I cbd I can't actually specify a location of .sas files. I can only define jobs and services. For both, the assets are nested under a "jobs" or "services" folder. And both are deployed as job definitions, not as .sas files.
Is there a way I don't see to define a place for .sas files to be uploaded?
Hi Chuck - correct, we support three categories of "job" - regular jobs (/jobs), web services (/services) and tests (/tests), all of which are deployed as "jobs" in Viya. We haven't built a feature for deploying SAS programs. We're happy to accept this as a feature request though. Would need to think about how we fit that into the framework - perhaps by having a sasFiles array, and deploying under /sasfiles in the appLoc root.
A short term workaround might be to deploy as Jobs, then write an additional job (using SAS code) to read the content and deploy as a ".sas" program.
@ccastillo232 - we found a workaround for this (credit to @mblauw-sas) which would give you the functionality at the cost of a slightly longer deployment process.
Basically, you create a jobs/admin/rebuild.sas program (as a Job) which converts every deployed job to a SAS Program in Drive. You can then call this job in the deployConfig.deployScripts array by pointing to sasjsbuild/jobs/admin/rebuild.sas. This will execute the code as "code" (rather than as a job) and so there will be no _program variable, so you must provide the appLoc. This can be a jobConfig.macroVars value.
Activity
allanbowe commentedon Sep 16, 2021
Hi Chuck - correct, we support three categories of "job" - regular jobs (/jobs), web services (/services) and tests (/tests), all of which are deployed as "jobs" in Viya. We haven't built a feature for deploying SAS programs. We're happy to accept this as a feature request though. Would need to think about how we fit that into the framework - perhaps by having a
sasFilesarray, and deploying under /sasfiles in the appLoc root.A short term workaround might be to deploy as Jobs, then write an additional job (using SAS code) to read the content and deploy as a ".sas" program.
This macro will list the jobs in a folder: https://core.sasjs.io/mv__getfoldermembers_8sas.html
This macro will grab the code from a job: https://core.sasjs.io/mv__getjobcode_8sas.html
And this macro can be used to create a SAS file (will also create any parent folders if needed): https://core.sasjs.io/mv__createfile_8sas.html
ccastillo232 commentedon Sep 16, 2021
Understood, thanks Allan.
allanbowe commentedon Sep 4, 2022
@ccastillo232 - we found a workaround for this (credit to @mblauw-sas) which would give you the functionality at the cost of a slightly longer deployment process.
Basically, you create a
jobs/admin/rebuild.sasprogram (as a Job) which converts every deployed job to a SAS Program in Drive. You can then call this job in thedeployConfig.deployScriptsarray by pointing tosasjsbuild/jobs/admin/rebuild.sas. This will execute the code as "code" (rather than as a job) and so there will be no_programvariable, so you must provide the appLoc. This can be ajobConfig.macroVarsvalue.Example config as follows:
To do the translation from Job to Studio Program you can make use of the following macros:
Creating the actual program is quite simple - just set up the fileref using the filesrvc engine, eg:
Happy to jump on a call to assist with setup.