Giter Site home page Giter Site logo

core's Introduction

Macro Core

npm package Github Workflow npm GitHub top language GitHub closed issues GitHub issues total lines Gitpod ready-to-code

Much quality. Many standards. The Macro Core library exists to save time and development effort! Herein ye shall find a veritable host of MIT-licenced, production quality SAS macros. These are a mix of tools, utilities, functions and code generators that are useful in the context of Application Development on the SAS platform (eg https://datacontroller.io). Contributions are welcome.

You can download and compile them all in just two lines of SAS code:

filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

Documentation: https://core.sasjs.io

Components

BASE folder (All Platforms)

  • OS independent
  • Works on all SAS Platforms
  • No X command
  • Prefixes: mf_, mp_

DDL folder (All Platforms)

  • OS independent
  • Works on all SAS Platforms
  • No X command
  • Prefixes: mddl_(lib)_ -> where lib can be "SAS" (in relation to a SAS component) or "DC" (in relation to a Data Controller component)

This library will not be used for storing data entries (such as formats or datalines). Where this becomes necessary in the future, a new repo will be created, in order to keep the NPM bundle size down (for the benefit of those looking to embed purely macros in their applications).

FCMP folder (All Platforms)

  • Function and macro names are identical, except for special cases
  • Prefixes: mcf_

The fcmp macros are used to generate fcmp functions, and can be used with or without the proc fcmp wrapper.

LUA folder

Wait - this is a macro library - what is LUA doing here? Well, it is a little known fact that you CAN run LUA within a SAS Macro. It has to be written to a text file with a .lua extension, from where you can %include it. So, without using the proc lua wrapper.

To contribute, simply write your freeform LUA in the LUA folder. Then run the build.py, which will convert all files with a ".lua" extension into a macro wrapper with an ml_ prefix (embedding the necessary data step put statements). You can then use your module in any program by running:

/* compile the lua module */
%ml_yourmodule()

/* Execute.  Do not use the restart keyword! */
proc lua;
submit;
  print(yourStuff);
endsubmit;
run;
  • Prefixes: ml_

META folder (SAS9 only)

Macros used in SAS EBI, which connect to the metadata server.

  • OS independent
  • Metadata aware
  • No X command
  • Prefixes: mm_

METAX folder (SAS9 only)

  • OS specific
  • Metadata aware
  • X command enabled
  • Prefixes: mmx_

SERVER folder (@sasjs/server only)

These macros are used for building applications using @sasjs/server - an open source REST API for Desktop SAS.

  • OS independent
  • @sasjs/server aware
  • No X command
  • Prefixes: ms_

VIYA folder (Viya only)

Macros used for interfacing with SAS Viya.

  • OS independent
  • No X command
  • Prefixes: mv_, mvf_

XPLATFORM folder (Viya, Meta, and Server)

Sometimes it is helpful to use a macro that can be used interchangeably regardless of the server type on which is is running (SASVIYA, SAS9, SASJS).

  • OS independent
  • No X command
  • Prefixes: mx_

Installation

First, download the repo to a location your SAS system can access. Then update your sasautos path to include the components you wish to have available, eg:

%let repoloc=/your/path/core;
options insert=(sasautos="&repoloc/base");
options insert=(sasautos="&repoloc/ddl");
options insert=(sasautos="&repoloc/fcmp");
options insert=(sasautos="&repoloc/lua");
options insert=(sasautos="&repoloc/meta");
options insert=(sasautos="&repoloc/metax");
options insert=(sasautos="&repoloc/server");
options insert=(sasautos="&repoloc/viya");
options insert=(sasautos="&repoloc/xplatform");

The above can be done directly in your sas program, via an autoexec, or an initialisation program.

Alternatively - for quick access - simply run the following! This file contains all the macros.

filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

Standards

File Properties

  • filenames much match macro names
  • filenames must be lowercase, without spaces
  • macro names must be lowercase
  • one macro per file
  • prefixes:
    • mcf for macro compiled functions (proc fcmp)
    • mddl for macros containing DDL (Data Definition Language)
    • mf for macro functions (can be used in open code).
    • ml for macros that are used to compile LUA modules
    • mm for metadata macros (interface with the metadata server).
    • mmx for macros that use metadata and are XCMD enabled (working on both windows and unix)
    • mp for macro procedures (which generate sas code)
    • ms for macro procedures that will only work with @sasjs/server
    • mv for macro procedures that will only work in Viya
    • mx for macros that work on Viya, SAS 9 EBI and SASjs Server
  • follow verb-noun convention
  • unix style line endings (lf)
  • individual lines should be no more than 80 characters long
  • UTF-8

Header Properties

The Macro Core documentation is created using doxygen. A full list of attributes can be found here but the following are most relevant:

  • file. This needs to be present in order to be recognised by doxygen.
  • brief. This is a short (one sentence) description of the macro.
  • details. A longer description, which can contain doxygen markdown.
  • param. Name of each input param followed by a description.
  • return. Explanation of what is returned by the macro.
  • version. The EARLIEST SAS version in which this macro is known to work.
  • author. Author name, contact details optional

All macros must be commented in the doxygen format, to enable the online documentation.

Dependencies

SAS code can contain one of two types of dependency - SAS Macros, and SAS Includes. When compiling projects using the SASjs CLI the doxygen header is scanned for @li items under the following headers:

  <h4> SAS Macros </h4>
  @li mf_nobs.sas
  @li mm_assignlib.sas

  <h4> SAS Includes </h4>
  @li somefile.ddl SOMEFREF
  @li someprogram.sas FREFTWO

The CLI can then extract all the dependencies and insert as precode (SAS Macros) or in a temp engine fileref (SAS Includes) when creating SAS Jobs and Services (and Tests).

When contributing to this library, it is therefore important to ensure that all dependencies are listed in the header in this format.

Coding Standards

  • Indentation = 2 spaces. No tabs!
  • no trailing white space
  • no invisible characters, other than spaces. If invisibles are needed, use hex literals.
  • Macro variables should not have the trailing dot (&var not &var.) unless necessary to prevent incorrect resolution
  • The closing %mend; should not contain the macro name.
  • All macros should be defined with brackets, even if no variables are needed - ie %macro x(); not %macro x;
  • Mandatory parameters should be positional, all optional parameters should be keyword (var=) style.
  • All dataset references must be 2 level (eg work.blah, not blah). This is to avoid contention when options DATASTMTCHK=ALLKEYWORDS is in effect, or the USER library is active.
  • Avoid naming collisions! All macro variables should be local scope. Use system generated work tables where possible - eg data ; set sashelp.class; run; data &output; set &syslast; run;
  • Where global macro variables are absolutely necessary, they should make use of &sasjs_prefix - see mp_init.sas
  • The use of quit; for proc sql is optional unless you are looking to benefit from the timing statistics.
  • Use sasjs lint!

General Notes

  • All macros should be compatible with SAS versions from support level B and above (so currently 9.3 and later). If an earlier version is not supported, then the macro should say as such in the header documentation, and exit gracefully.
  • It's best to avoid special / non-ASCII characters for compatibility with the widest variety of SAS installations.

Breaking Changes

We are currently on major release v4. Breaking changes should be marked with the deprecated doxygen tag. The following changes are planned when the next major/breaking release (v5) becomes necessary:

  • mf_getuniquelibref.sas to have the deprecated maxtried parameter removed (no longer needed)
  • mp_testservice.sas to be renamed as mp_execute.sas (as it doesn't actually test anything)
  • insert_cmplib option of mcf_xxx macros will be deprecated (the option is now checked automatically with value inserted only if needed)
  • mcf_xxx macros to have wrap= option defaulted to YES for convenience. Set this option explicitly to avoid issues.
  • mp_getddl.sas to be renamed to mp_ds2ddl.sas (consistent with other ds2xxx macros). A wrapper macro is already in place, and you are able to use this immediately. The default for SHOWLOG will also be YES instead of NO.
  • mp_coretable.sas will be replaced by the standalone macros in the ddl folder (which are already available)

Star Gazing

If you find this library useful, please leave a star and help us grow our star graph!

Other SAS Repositories

The following repositories are also worth checking out:

Contributors ✨

All Contributors

Thanks goes to these wonderful people (emoji key):

Allan Bowe
Allan Bowe

💼 💻 🖋 📖 🚇 🚧 🧑‍🏫 💬 👀 ⚠️
rafgag
rafgag

💻
Trevor Moody
Trevor Moody

💻
Krishna Acondy
Krishna Acondy

💻 🚇 📝 🖋 🤔 📹
Muhammad Saad
Muhammad Saad

💻 🤔
Yury Shkoda
Yury Shkoda

💻 🚇 📹
Mihajlo Medjedovic
Mihajlo Medjedovic

🚇
kkchandok
kkchandok

🤔
Vladislav Parhomchik
Vladislav Parhomchik

⚠️ 👀
Vignesh T.
Vignesh T.

🐛
Bart Jablonski
Bart Jablonski

💻
Ikko Ashimine
Ikko Ashimine

💻
Henrik Forsell
Henrik Forsell

📖
Rud Faden
Rud Faden

💻
andyjessen
andyjessen

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

core's People

Contributors

allanbowe avatar allanprc avatar allcontributors[bot] avatar andyjessen avatar dependabot[bot] avatar eltociear avatar ivortownsend avatar krishna-acondy avatar medjedovicm avatar rafgag avatar saadjutt01 avatar sharky618 avatar stestox avatar tmoody avatar vladislavparhomchik avatar yuryshkoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

core's Issues

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you can benefit from your bug fixes and new features again.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can fix this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here are some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Cannot push to the Git repository.

semantic-release cannot push the version tag to the branch main on the remote Git repository with URL https://github.com/sasjs/core.git.

This can be caused by:


Good luck with your project ✨

Your semantic-release bot 📦🚀

mp_searchtool fuzzy match

Hello,

Can the macro find fuzzy matches? . If the variable VSORRES is in multiple datasets but with a different suffix such as VSORRES1, VSORRES_02 etc...how would the macro parameters be filled.

%mp_searchcols(libs=work, cols=vsorres);

Risky default value for maxtries in %mf_getuniquelibref.sas

base/mf_getuniquelibref.sas has a default value for &maxtries that is too large should it loop that far.

Better still, &maxtries can be dynamic and of no concern to the user:

    %let maxtries=%eval(10**(8-%length(&prefix.))-1);

Additionally, the pre-assignment of the new libname, to point to the Work library location, runs counter to the stated intent of returning an unused libref.

mp_storediffs()

A new macro is needed to support a single-source detailed audit history of ALL changes in Data Controller

It should amalgamate the following inputs:

  • Deletes
  • Appends
  • Updates
  • Originals

And produce a table in the following format:

create table work.audit_history(
  load_id char(32),
  processed_dttm num format=E8601DT26.6,
  libref char(8),
  dsn char(32),
  key_hash char(32),
  move_type char(1),
  is_pk char(1),
  is_diff char(1),
  tgtvar_type char(1),
  tgtvar_nm char(32),
  oldval_num num,
  newval_num num,
  oldval_char char(32767),
  newval_char char(32767)
);

Add VARINITCHECK=ERROR to MP_INIT()

As highlighted by SAS legends such as Bruno Müeller and Bill Quinn, the varinitchk option can help avoid data disasters from simple typos.

Adding options varinitchk=ERROR; to the SASjs test suite caused 12/53 tests to fail.

  • Add varinitchk=ERROR to mp_init.sas
  • Ensure uninitialised variables are fixed in all 12 failing tests

mp_init autocorrect option

The autocorrect option set in the mp_init macro is set to allow misspellings when the intent is to prevent this correction.

mX_webout() - invalid json caused by missing MEMSIZE

The previous update causes invalid json when MEMSIZE is empty:

    memsize="%sysfunc(INPUTN(%sysfunc(getoption(memsize)), best.),sizekmg.)";
    memsize=""; /* force missing */
    memsize=quote(cats(memsize));
    put ',"MEMSIZE" : ' memsize;

This took a bit longer to debug as the log had no errors - only:

NOTE: Invalid argument to function QUOTE('') at line 23 column 13.

To make this issue easier to discover in future, perhaps the undocumented note2err setting should be applied in mp_init().

mm_webout failing in WLATIN1 for certain characters

Following the change to use DATASTEP to generate JSON (to support invalid characters) we inadvertently reverted support for certain WLATIN1 characters.

To fix, we can check SYSENCODING - if WLATIN1 then we will use PROCJSON (and drop invalid character support) instead of DATASTEP.

`mp_dirlist()` fails un-gracefully when the target directory does not exist

Current log as follows:

 ERROR: Argument 1 to function DOPTNUM(0) at line 74 column 63 is invalid.
 directory=  filepath=  fref=#LN00053 fref2=  file_or_folder=  filename=  ext=  msg=  foption=  level=0 rc=0 did=0 numopts=0 i=. dnum=. midd=. dmsg=  midf=. fmsg=  _ERROR_=1 _N_=1
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.DATA1 may be incomplete.  When this step was stopped there were 0 observations and 7 variables.
 WARNING: Data set WORK.DATA1 was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.01 seconds
       system cpu time     0.00 seconds
       memory              715.93k
       OS Memory           26536.00k
       Timestamp           11/03/2022 10:18:18 AM
       Step Count                        27  Switch Count  0
       Page Faults                       2
       Page Reclaims                     171
       Page Swaps                        0
       Voluntary Context Switches        4
       Involuntary Context Switches      0
       Block Input Operations            2344
       Block Output Operations           8
       
 
 ERROR: Variable filepath is not on file WORK.DATA1.

create sort-in-place macro

There are certain edge cases when it can be convenient to sort a SAS dataset that has indexes applied, for instance:

  • To improve performance in certain cases
  • To allow adjacent records to be viewed directly in the dataset
  • To reduce dataset size (eg when there are deleted records)

A "sort in place" macro, that would work at both dataset and library level, would be helpful here. This would pick up the existing primary key or unique index and sort on that.

mp_searchdata throws warnings when maxobs exceeded

To reproduce:

%mp_searchdata(lib=sashelp, ds=class, string=l,outobs=5)

Log result:

 WARNING: Statement terminated early due to OUTOBS=5 option.
 NOTE: Table MPSEARCH.CLASS created, with 5 rows and 5 columns.
 
 Search query for CLASS took       0.00462007522583 seconds
 WARNING: SQLRC=4 when processing CLASS

Expected : No warnings or errors

Update `mv_webout()` for Viya 4 WEB approach

When the @sasjs/adapter is used to send requests to SAS Viya using the WEB approach (useComputeApi:undefined|null) then data is condensed across a set of macro variables.

This speeds up the request slightly as it avoids file handling.

In 3.5 we used Lua to convert the macro variables back to CSV files. Unfortunately this fails in Viya 4 due to the lack of a lua IO module:

MPRINT(WEBOUT.MV_WEBOUT):   proc lua;
MPRINT(WEBOUT.MV_WEBOUT):   submit;
MPRINT(WEBOUT.MV_WEBOUT):   run;
<span style="color: blue"></span>
<span style="color: blue">NOTE: Lua initialized.</span>
1                                                          The SAS System                            Tuesday, 29 March 2022 20:15:00

<span style="color: red">ERROR: ...her-2a964713-fda9-4d80-97b4-98a4f5ac5902-n9trj/sasjs.lua:33: attempt to index global &#39;io&#39; (a nil value)</span>
stack traceback:
	...her-2a964713-fda9-4d80-97b4-98a4f5ac5902-n9trj/sasjs.lua:33: in main chunk
	[C]: in function &#39;require&#39;
	SUBMIT block:2: in main chunk
<span style="color: red">ERROR: There was an error submitting the provided code</span>
<span style="color: blue">NOTE: The SAS System stopped processing this step because of errors.</span>
<span style="color: blue">NOTE: PROCEDURE LUA used (Total process time):</span>

To avoid the above error, the mv_webout macro must be converted to data step.

The adapter will also need to reduce the size of the created variables from 65k to 32.7k chars.

create `ddl` folder

More and more macros are depending on data structures, and they cannot keep being added to mp_coretable.sas as this will end up getting very big

Instead we should create a new ddl folder for storing DDL related activity.

We should NOT use this repo for storing data values - it would get extremely big. As and when this becomes necessary, we should create a new repo for that.

add stateDetails to mv_jobwaitfor

If a Viya job finishes with a WARNING the state is marked as 'completed' and so an additional response attribute (stateDetails) must be checked to see whether it ran cleanly.

The mv_jobwaitfor.sas macro should be updated to cater for this scenario, changing syscc=4 if the job is in WARNING state, or a higher number for an error.

This line should have the /state endpoint removed:

call symputx(cats('joburi',_n_),substr(uri,1,55)!!'/state','l')

This line:

       headers "Accept"="text/plain"

should change to:

      headers "Accept"="application/json"

The state / state details can then be extracted from the job JSON rather than joburi/state endpoint. proc json could be used, with a temporary libname, eg:

%local libref1; %let libref1=%mf_getuniquelibref();

We can also add the following to prevent further jobs being executed when in an error condition:

 %mp_abort(iftrue=(&syscc > 0)
   ,mac=&sysmacroname
   ,msg=%str(&syscc>0 )
 )
  • Job header includes a markdown table describing the outds table
  • Outds table includes the statedetails column, whether it is returned or not
  • The syscc variable is updated with an appropriate value
  • The error / warning message (if any) is printed to the log
  • The mf_getuniquelibref macro is in the <h4> SAS Macros </h4> section

More info on stateDetails: https://communities.sas.com/t5/Developers/Extracting-job-state/td-p/700923

Macro to lock a table

When performing operations that require multiple passes, it is helpful to mark the corresponding table(s) as locked to prevent data inconsistencies.

The macro should cater for:

  • database use
  • retry X times with Y gap should the table be locked

Macro Scope Test Assertion

When writing macros it's important to ensure that there is no leak in scope.

SAS does not have automatic scope checking, and it is easy to create non-local variables by mistake (leading to hard-to-detect errors).

Therefore, a macro that can snapshot variables before and after a macro execution for running black box SAS tests would be helpful.

Variable __COMMAND is uninitialized

core/base/mp_zip.sas

Lines 52 to 66 in d0a0274

length __command $4000;
if file_or_folder='file';
command=cats('ods package add file="',filepath
,'" mimetype="application/x-compress";');
call execute(command);
run;
/* tidy up */
%if &debug=NO %then %do;
proc sql; drop table &ds;quit;
%end;
%end;
%else %if &type=DATASET %then %do;
data _null_;
set &in;
length __command $4000;

I believe line 54 & 67 should refer to __COMMAND instead COMMAND

reset syscc in mp_abort for Viya response

When running mp_abort using the compute api approach the response is not being surfaced to the adapter.

It transpires that the reason is the existence of a non-zero SYSCC value results in state of error for the job, as per the extract below.

In order to handle errors gracefully we should reset the value for SYSCC (the final value is displayed anyway in the response json).

{
	"completedTimeStamp": "2021-06-28T20:43:12Z",
	"creationTimeStamp": "2021-06-28T20:43:11Z",
	"id": "EEE43D54-4F36-5243-A103-13FBFDADBD30",
	"jobConditionCode": 1012,
	"links": [{
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30",
		"method": "GET",
		"rel": "self",
		"type": "application\/vnd.sas.compute.job",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/state",
		"method": "GET",
		"rel": "state",
		"type": "text\/plain",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/state"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/state?value=canceled",
		"method": "PUT",
		"rel": "cancel",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/state?value=canceled"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30",
		"method": "DELETE",
		"rel": "delete",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/log",
		"itemType": "application\/vnd.sas.compute.log.line",
		"method": "GET",
		"rel": "log",
		"type": "application\/vnd.sas.collection",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/log"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/listing",
		"itemType": "application\/vnd.sas.compute.log.line",
		"method": "GET",
		"rel": "listing",
		"type": "application\/vnd.sas.collection",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/listing"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/results",
		"itemType": "application\/vnd.sas.compute.result",
		"method": "GET",
		"rel": "results",
		"type": "application\/vnd.sas.collection",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000\/jobs\/EEE43D54-4F36-5243-A103-13FBFDADBD30\/results"
	}, {
		"href": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000",
		"method": "GET",
		"rel": "up",
		"type": "application\/vnd.sas.compute.session",
		"uri": "\/compute\/sessions\/3e53cb30-276c-4b25-9562-ad5409904956-ses0000"
	}],
	"listingStatistics": {
		"lineCount": 0,
		"modifiedTimeStamp": "2021-06-28T20:43:11Z"
	},
	"logStatistics": {
		"lineCount": 1934,
		"modifiedTimeStamp": "2021-06-28T20:43:12Z"
	},
	"sessionId": "3e53cb30-276c-4b25-9562-ad5409904956-ses0000",
	"state": "error",
	"stateElapsedTime": 0,
	"statistics": {
		"systemCpuTime": 0.05,
		"userCpuTime": 0.21
	},
	"version": 1
}

Support STPSRV_HEADER in Base SAS

Provide support for such functions like STPSRV_HEADER .
From log:

ERROR 68-185: The function STPSRV_HEADER is unknown, or cannot be accessed.

Add sysvlong to sasjs response

For debugging client issues it is helpful to immediately understand the version being used. We can add this in the server response.

binary data breaks mp_ds2cards.sas

The current mechanism cannot cope with binary data

image

To reproduce:

data test;
  format bin $hex500.;
  do x=1 to 250;
   z=byte(x);
   bin=trim(bin)!!z;
  end;
  put bin=;
run;

%mp_ds2cards(base_ds=work.test,showlog=YES
	, cards_file="%sysfunc(pathname(work))/c2.sas"
    , tgt_ds=work.y
    , append=
)

%inc "%sysfunc(pathname(work))/c2.sas"/source2;

proc compare base=test compare=y;
run;

mf_getapploc fails for testsetup

The logic in mf_getapploc.sas won't work in the sasjs test testsetup (or teardown) - hence, should be adjusted for these specific cases

proc json - some code points did not transcode

ERROR: Some code points did not transcode.
MPRINT(MP_JSONOUT):   run;
ERROR: The JSON writer is in an error state at this point and no more items may be inserted.
ERROR: Due to the previous error, the JSON output file is incomplete and invalid, or in some cases, unable to be created. If created, the JSON output file is retained so that you can review it to help determine the cause of the error.

The above error is typically seen when proc json tries to export a non valid character. We implemented proc json in the sasjs/adapter for speed however this instability is affecting data controller and so we must switch back to the trusty data step.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.