1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-15 04:20:05 +00:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Allan Bowe
72123aeeb7 Merge pull request #305 from sasjs/cli1229
Making _addjesbeginendmacros configurable
2022-08-25 14:21:04 +01:00
Allan Bowe
236d1ae25f Merge branch 'main' into cli1229 2022-08-25 14:20:57 +01:00
Allan Bowe
7b3844a391 chore: updating all.sas 2022-08-21 16:02:20 +00:00
Allan Bowe
202de36042 fix: options to remove _addjesbeginendmacros from Viya Jobs 2022-08-21 16:01:50 +00:00
2 changed files with 66 additions and 22 deletions

44
all.sas
View File

@@ -22276,14 +22276,25 @@ options noquotelenmax;
@param path= The full path (on SAS Drive) where the job will be created @param path= The full path (on SAS Drive) where the job will be created
@param name= The name of the job @param name= The name of the job
@param desc= The description of the job @param desc= (Created by the mv_createjob.sas macro) The job description
@param precode= Space separated list of filerefs, pointing to the code that @param precode= Space separated list of filerefs, pointing to the code that
needs to be attached to the beginning of the job needs to be attached to the beginning of the job
@param code= Fileref(s) of the actual code to be added @param code= (ft15f001) Fileref(s) of the actual code to be added
@param access_token_var= The global macro variable to contain the access token @param access_token_var= (ACCESS_TOKEN) Global macro variable containing the
@param grant_type= valid values are "password" or "authorization_code" access token
(unquoted). The default is authorization_code. @param grant_type= (sas_services) Valid values:
@param replace= select NO to avoid replacing any existing job in that location @li sas_services
@li detect
@li authorization_code
@li password
@param replace= (YES) select NO to avoid replacing any existing job
@param addjesbeginendmacros= (false) Relates to the `_addjesbeginendmacros`
setting. Normally this would always be false however due to a Viya bug
(https://github.com/sasjs/cli/issues/1229) this is now configurable. Valid
values:
@li true
@li false
@li 0 - this will prevent the flag from being set (job will default to true)
@param contextname= Choose a specific context on which to run the Job. Leave @param contextname= Choose a specific context on which to run the Job. Leave
blank to use the default context. From Viya 3.5 it is possible to configure blank to use the default context. From Viya 3.5 it is possible to configure
a shared context - see a shared context - see
@@ -22304,6 +22315,7 @@ https://go.documentation.sas.com/?docsetId=calcontexts&docsetTarget=n1hjn8eobk5p
,replace=YES ,replace=YES
,debug=0 ,debug=0
,contextname= ,contextname=
,addjesbeginendmacros=false
); );
%local oauth_bearer; %local oauth_bearer;
%if &grant_type=detect %then %do; %if &grant_type=detect %then %do;
@@ -22427,19 +22439,29 @@ run;
%end; %end;
/* set up the body of the request to create the service */ /* set up the body of the request to create the service */
%local fname3; %local fname3 comma;
%let fname3=%mf_getuniquefileref(); %let fname3=%mf_getuniquefileref();
data _null_; data _null_;
file &fname3 TERMSTR=' '; file &fname3 TERMSTR=' ';
length string $32767; length string $32767;
string=cats('{"version": 0,"name":"' string=cats('{"version": 0,"name":"'
,"&name" ,"&name"
,'","type":"Compute","parameters":[{"name":"_addjesbeginendmacros"' ,'","type":"Compute","parameters":['
,',"type":"CHARACTER","defaultValue":"false"}'); %if &addjesbeginendmacros ne 0 %then %do;
,'{"name":"_addjesbeginendmacros"'
,',"type":"CHARACTER","defaultValue":"'
,"&addjesbeginendmacros"
,'"}'
%let comma=%str(,);
%end;
);
context=quote(cats(symget('contextname'))); context=quote(cats(symget('contextname')));
if context ne '""' then do; if context ne '""' then do;
string=cats(string,',{"version": 1,"name": "_contextName","defaultValue":' string=cats(string
,context,',"type":"CHARACTER","label":"Context Name","required": false}'); ,"&comma"
,'{"version": 1,"name": "_contextName","defaultValue":'
,context,',"type":"CHARACTER","label":"Context Name","required": false}'
);
end; end;
string=cats(string,'],"code":"'); string=cats(string,'],"code":"');
put string; put string;

View File

@@ -34,14 +34,25 @@
@param path= The full path (on SAS Drive) where the job will be created @param path= The full path (on SAS Drive) where the job will be created
@param name= The name of the job @param name= The name of the job
@param desc= The description of the job @param desc= (Created by the mv_createjob.sas macro) The job description
@param precode= Space separated list of filerefs, pointing to the code that @param precode= Space separated list of filerefs, pointing to the code that
needs to be attached to the beginning of the job needs to be attached to the beginning of the job
@param code= Fileref(s) of the actual code to be added @param code= (ft15f001) Fileref(s) of the actual code to be added
@param access_token_var= The global macro variable to contain the access token @param access_token_var= (ACCESS_TOKEN) Global macro variable containing the
@param grant_type= valid values are "password" or "authorization_code" access token
(unquoted). The default is authorization_code. @param grant_type= (sas_services) Valid values:
@param replace= select NO to avoid replacing any existing job in that location @li sas_services
@li detect
@li authorization_code
@li password
@param replace= (YES) select NO to avoid replacing any existing job
@param addjesbeginendmacros= (false) Relates to the `_addjesbeginendmacros`
setting. Normally this would always be false however due to a Viya bug
(https://github.com/sasjs/cli/issues/1229) this is now configurable. Valid
values:
@li true
@li false
@li 0 - this will prevent the flag from being set (job will default to true)
@param contextname= Choose a specific context on which to run the Job. Leave @param contextname= Choose a specific context on which to run the Job. Leave
blank to use the default context. From Viya 3.5 it is possible to configure blank to use the default context. From Viya 3.5 it is possible to configure
a shared context - see a shared context - see
@@ -62,6 +73,7 @@ https://go.documentation.sas.com/?docsetId=calcontexts&docsetTarget=n1hjn8eobk5p
,replace=YES ,replace=YES
,debug=0 ,debug=0
,contextname= ,contextname=
,addjesbeginendmacros=false
); );
%local oauth_bearer; %local oauth_bearer;
%if &grant_type=detect %then %do; %if &grant_type=detect %then %do;
@@ -185,19 +197,29 @@ run;
%end; %end;
/* set up the body of the request to create the service */ /* set up the body of the request to create the service */
%local fname3; %local fname3 comma;
%let fname3=%mf_getuniquefileref(); %let fname3=%mf_getuniquefileref();
data _null_; data _null_;
file &fname3 TERMSTR=' '; file &fname3 TERMSTR=' ';
length string $32767; length string $32767;
string=cats('{"version": 0,"name":"' string=cats('{"version": 0,"name":"'
,"&name" ,"&name"
,'","type":"Compute","parameters":[{"name":"_addjesbeginendmacros"' ,'","type":"Compute","parameters":['
,',"type":"CHARACTER","defaultValue":"false"}'); %if &addjesbeginendmacros ne 0 %then %do;
,'{"name":"_addjesbeginendmacros"'
,',"type":"CHARACTER","defaultValue":"'
,"&addjesbeginendmacros"
,'"}'
%let comma=%str(,);
%end;
);
context=quote(cats(symget('contextname'))); context=quote(cats(symget('contextname')));
if context ne '""' then do; if context ne '""' then do;
string=cats(string,',{"version": 1,"name": "_contextName","defaultValue":' string=cats(string
,context,',"type":"CHARACTER","label":"Context Name","required": false}'); ,"&comma"
,'{"version": 1,"name": "_contextName","defaultValue":'
,context,',"type":"CHARACTER","label":"Context Name","required": false}'
);
end; end;
string=cats(string,'],"code":"'); string=cats(string,'],"code":"');
put string; put string;