Friday, October 28, 2016

How to set special characters in SAS Base code

If you ever end up having a sas variable, which contains special characters in it, and you want to split them into each separate variable, you need to use a ascii number equivalent to required special character,and at x at the end of the string.
For example, if the special character is tabulator:

In ASCII table, '09'x is a ascii equivalent to tab character.

Saturday, October 22, 2016

How to round the number up to 2 digits in Javascript

Sometimes you need to round up the number up to 2 digits. For example, you calculation has to show a result in currency.

There are two solutions to use on internet:

1) Use Math.random function.

var a=123.4567;


However, this is not really good, as for example in case of
var a=1.005;
Math.random(a*100)/100 results into 1 instead of 1.01.

2) use toFixed(2)

However, it is more secure option to use a.toFixed(2), which would return element as fixed 2 decimal value

Friday, January 15, 2016

How to download/upload a SAS dataset from server to your local machine

There is a neat way the EG offers you to download SAS datasets.
Under a menu bar, there are a options

  • "Tasks" - "Data" - "Upload Data Files to Server" and 
  •  "Tasks" - "Data" - "Download Data Files to PC" 
In case of "Download Data Files to PC", you need to choose a dataset you want to transfer.

My humble suggestion is to first subset the original dataset to a temporal dataset you exactly need, and download only the temporal dataset.

Detailed screenshots will follow...