1
0
mirror of https://github.com/sasjs/core.git synced 2026-01-09 10:20:06 +00:00

Compare commits

...

3 Commits

7 changed files with 35 additions and 25 deletions

View File

@@ -5,4 +5,4 @@ image:
file: .gitpod.dockerfile file: .gitpod.dockerfile
vscode: vscode:
extensions: extensions:
- sasjs.sasjs-for-vscode@1.7.2:R6y1nzpFh2P99BZg5FgH5g== - sasjs.sasjs-for-vscode

View File

@@ -2,6 +2,9 @@
"noTrailingSpaces": true, "noTrailingSpaces": true,
"noEncodedPasswords": true, "noEncodedPasswords": true,
"hasDoxygenHeader": true, "hasDoxygenHeader": true,
"hasMacroNameInMend": false,
"hasMacroParentheses": true,
"noNestedMacros": false,
"noSpacesInFileNames": true, "noSpacesInFileNames": true,
"maxLineLength": 135, "maxLineLength": 135,
"lowerCaseFileNames": true, "lowerCaseFileNames": true,

5
.vscode/extensions.json vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"recommendations": [
"sasjs.sasjs-for-vscode"
]
}

42
all.sas
View File

@@ -3919,8 +3919,11 @@ create table &outds (rename=(
@details PROC JSON is faster but will produce errs like the ones below if @details PROC JSON is faster but will produce errs like the ones below if
special chars are encountered. special chars are encountered.
>An object or array close is not valid at this point in the JSON text. > ERROR: Some code points did not transcode.
>Date value out of range
> An object or array close is not valid at this point in the JSON text.
> Date value out of range
If this happens, try running with ENGINE=DATASTEP. If this happens, try running with ENGINE=DATASTEP.
@@ -3929,7 +3932,9 @@ create table &outds (rename=(
filename tmp temp; filename tmp temp;
data class; set sashelp.class;run; data class; set sashelp.class;run;
%mp_jsonout(OPEN,jref=tmp)
%mp_jsonout(OBJ,class,jref=tmp) %mp_jsonout(OBJ,class,jref=tmp)
%mp_jsonout(CLOSE,jref=tmp)
data _null_; data _null_;
infile tmp; infile tmp;
@@ -3942,18 +3947,18 @@ create table &outds (rename=(
For more information see https://sasjs.io For more information see https://sasjs.io
@param action Valid values: @param action Valid values:
* OPEN - opens the JSON @li OPEN - opens the JSON
* OBJ - sends a table with each row as an object @li OBJ - sends a table with each row as an object
* ARR - sends a table with each row in an array @li ARR - sends a table with each row in an array
* CLOSE - closes the JSON @li CLOSE - closes the JSON
@param ds the dataset to send. Must be a work table. @param ds the dataset to send. Must be a work table.
@param jref= the fileref to which to send the JSON @param jref= the fileref to which to send the JSON
@param dslabel= the name to give the table in the exported JSON @param dslabel= the name to give the table in the exported JSON
@param fmt= Whether to keep or strip formats from the table @param fmt= Whether to keep or strip formats from the table
@param engine= Which engine to use to send the JSON, options are: @param engine= Which engine to use to send the JSON, valid options are:
* PROCJSON (default) @li PROCJSON (default)
* DATASTEP @li DATASTEP (more reliable when data has non standard characters)
@param dbg= DEPRECATED - was used to conditionally add PRETTY to @param dbg= DEPRECATED - was used to conditionally add PRETTY to
proc json but this can cause line truncation in large files. proc json but this can cause line truncation in large files.
@@ -4075,11 +4080,12 @@ create table &outds (rename=(
%end; %end;
%else %if &action=CLOSE %then %do; %else %if &action=CLOSE %then %do;
data _null_;file &jref encoding='utf-8'; data _null_;file &jref encoding='utf-8' mod;
put "}"; put "}";
run; run;
%end; %end;
%mend;/** %mend;
/**
@file @file
@brief Convert all library members to CARDS files @brief Convert all library members to CARDS files
@details Gets list of members then calls the <code>%mp_ds2cards()</code> macro. @details Gets list of members then calls the <code>%mp_ds2cards()</code> macro.
@@ -7301,8 +7307,6 @@ run;
*/ */
%mm_updatestpsourcecode(stp=&tree/&stpname %mm_updatestpsourcecode(stp=&tree/&stpname
,stpcode="&directory/&filename" ,stpcode="&directory/&filename"
,frefin=&frefin.
,frefout=&frefout.
,mdebug=&mdebug ,mdebug=&mdebug
,minify=&minify) ,minify=&minify)
@@ -7510,7 +7514,7 @@ data _null_;
put '%end; '; put '%end; ';
put ' '; put ' ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';
put ' data _null_;file &jref encoding=''utf-8''; '; put ' data _null_;file &jref encoding=''utf-8'' mod; ';
put ' put "}"; '; put ' put "}"; ';
put ' run; '; put ' run; ';
put '%end; '; put '%end; ';
@@ -12037,7 +12041,7 @@ data _null_;
put '%end; '; put '%end; ';
put ' '; put ' ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';
put ' data _null_;file &jref encoding=''utf-8''; '; put ' data _null_;file &jref encoding=''utf-8'' mod; ';
put ' put "}"; '; put ' put "}"; ';
put ' run; '; put ' run; ';
put '%end; '; put '%end; ';
@@ -12169,7 +12173,7 @@ data _null_;
put '%end; '; put '%end; ';
put '%else %if &action=ARR or &action=OBJ %then %do; '; put '%else %if &action=ARR or &action=OBJ %then %do; ';
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt '; put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt ';
put ' ,jref=&fref,engine=PROCJSON,dbg=%str(&_debug) '; put ' ,jref=&fref,engine=DATASTEP,dbg=%str(&_debug) ';
put ' ) '; put ' ) ';
put '%end; '; put '%end; ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';
@@ -15376,7 +15380,7 @@ libname &libref clear;
filename &fref1 clear; filename &fref1 clear;
%mend;/** %mend;/**
@file mv_webout.sas @file
@brief Send data to/from the SAS Viya Job Execution Service @brief Send data to/from the SAS Viya Job Execution Service
@details This macro should be added to the start of each Job Execution @details This macro should be added to the start of each Job Execution
Service, **immediately** followed by a call to: Service, **immediately** followed by a call to:
@@ -15388,7 +15392,7 @@ filename &fref1 clear;
following syntax: following syntax:
data some datasets; * make some data ; data some datasets; * make some data ;
retain some columns; retain some columns;
run; run;
%mv_webout(OPEN) %mv_webout(OPEN)
@@ -15539,7 +15543,7 @@ filename &fref1 clear;
%end; %end;
%else %if &action=ARR or &action=OBJ %then %do; %else %if &action=ARR or &action=OBJ %then %do;
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt
,jref=&fref,engine=PROCJSON,dbg=%str(&_debug) ,jref=&fref,engine=DATASTEP,dbg=%str(&_debug)
) )
%end; %end;
%else %if &action=CLOSE %then %do; %else %if &action=CLOSE %then %do;

View File

@@ -376,8 +376,6 @@ run;
*/ */
%mm_updatestpsourcecode(stp=&tree/&stpname %mm_updatestpsourcecode(stp=&tree/&stpname
,stpcode="&directory/&filename" ,stpcode="&directory/&filename"
,frefin=&frefin.
,frefout=&frefout.
,mdebug=&mdebug ,mdebug=&mdebug
,minify=&minify) ,minify=&minify)

View File

@@ -196,7 +196,7 @@ data _null_;
put '%end; '; put '%end; ';
put ' '; put ' ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';
put ' data _null_;file &jref encoding=''utf-8''; '; put ' data _null_;file &jref encoding=''utf-8'' mod; ';
put ' put "}"; '; put ' put "}"; ';
put ' run; '; put ' run; ';
put '%end; '; put '%end; ';

View File

@@ -335,7 +335,7 @@ data _null_;
put '%end; '; put '%end; ';
put ' '; put ' ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';
put ' data _null_;file &jref encoding=''utf-8''; '; put ' data _null_;file &jref encoding=''utf-8'' mod; ';
put ' put "}"; '; put ' put "}"; ';
put ' run; '; put ' run; ';
put '%end; '; put '%end; ';
@@ -467,7 +467,7 @@ data _null_;
put '%end; '; put '%end; ';
put '%else %if &action=ARR or &action=OBJ %then %do; '; put '%else %if &action=ARR or &action=OBJ %then %do; ';
put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt '; put ' %mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt ';
put ' ,jref=&fref,engine=PROCJSON,dbg=%str(&_debug) '; put ' ,jref=&fref,engine=DATASTEP,dbg=%str(&_debug) ';
put ' ) '; put ' ) ';
put '%end; '; put '%end; ';
put '%else %if &action=CLOSE %then %do; '; put '%else %if &action=CLOSE %then %do; ';