Jan 8, 2020

Enable dark mode in SAS Enterprise Guide 8.1

To activate dark mode in SAS Enterprise Guide 8.1 use these steps:


  1. Open Enterprise Guide 8.1
  2. Click Tools menu then select Options
  3. Select General on left then in Color Theme under Visual Experience choose Ignite(Dark).
For more information visit Here.

Jan 7, 2020

How to read 2-digit year properly with YEARCUTOFF SAS options

If dates in your external data sources or SAS program statements contain two-digit years, you can determine which century prefix should be assigned to them by using the YEARCUTOFF= system option.
The YEARCUTOFF= system option specifies the first year of the 100-year span that is used to determine the century of a two-digit year.
Before you use the YEARCUTOFF= system option, examine the dates in your data:

  •  If the dates in your data fall within a 100-year span, you can use the YEARCUTOFF= system option. 
  • If the dates in your data do not fall within a 100-year span, you must either convert the two-digit years to to four-digit years or use a DATA step with conditional logic to assign the proper century prefix.
 Once you've determined that the YEARCUTOFF= system option is appropriate for your range of data, you can determine the setting to use. The best setting for YEARCUTOFF= is a year just slightly lower than the lowest year in your data. For example, if you have data in a range from 1921 to 1999, set YEARCUTOFF= to 1920, if that is not already your system default. The result of setting YEARCUTOFF= to 1920 is that

  •  SAS interprets all two-digit dates in the range of 20 through 99 as 1920 through 1999. 
  • SAS interprets all two-digit dates in the range 00 through 19 as 2000 through 2019.
If you want to check you current default yearcutoff value, run this code:
proc options option=yearcutoff;
run;

You will see something like this(date may be different) as response in SAS Log:


 YEARCUTOFF=1920   Cutoff year for DATE and DATETIME informats and functions

Example:
Before changing default value:
Code:
       data yearTest;
            date='01jan20'd;
           put 'Date= ' date date9.;

        run;
Response in log:
      Date=01JAN1920

After changing default value:
Code:
     options yearcutoff = 1950;
       data yearTest;
            date='01jan20'd;
           put 'Date= ' date date9.;

        run;
Response in log:
      Date=01JAN2020

Your system administrator may change the default to suit specific needs at your work site.





Nov 21, 2019

Read Scientific Notation in SAS

If numeric value has more than 12 digit SAS show the number in *E* form. We can use SAS format 'BEST<N>.' to read it properly. SAS will handle only 15 digit properly. If you have more than 15 digit in source table(like hadoop) then translate it to character while reading data because SAS does not show numeric value correctly after 15 digit.
Example:
DATA test;
    /* Create numeric column and assign value */
    id = 1000000000000;
   /* Create second numeric column and assign value from above */
   id2 = id;
    /*Apply format into id2 and print id as it is and print result into the log */
    put id2= BEST13. id=;
RUN;
Log:
NOTE: Compression was disabled for data set WORK.TEST because compression overhead would increase the size of the data set.
id2=1000000000000 id=1E12
NOTE: The data set WORK.TEST has 1 observations and 2 variables.

Oct 23, 2019

Where statement

Selects observations from SAS data sets that meet a particular condition.

If it is a big table then using the WHERE statement will improve the efficiency of your SAS programs because SAS is not required to read all observations from the input data set. It will only read matched records from input data set.

Some examples of using operands in WHERE expressions:
  • where number >= 10;>
  • where createDate>='01jan2010'd and createTime>='8:00't;
  • where countryCode='US';
Example:
Data cars; * This step create sas dataset cars in work library;
 Set sashelp.cars; * This reads SAS dataset cars from sashelp library;
  where make='Toyota';*Reads only make='Toyota' cars;
Run;

Oct 22, 2019

How to write comment in SAS code




Comment is very helpful and recommended for programmers to use because it helps if other than original developer needs to update the code. There are two ways to comment in SAS programming. You can use either one.

  1. Start with * (asterisk) and end with ; (semi colon).
  2. This way you can comment only one line. You can write anything in this place. Example: *This is comment;

  3. Start with /* and end with */.

    Shortcut - CTRL+/ to comment, CTRL+SHIFT+/ to uncomment.
  4. This way you can comment any number of lines. All the texts inside these two signs will not be used in SAS run. Example: /* This is SAS comment. */


SAS Certificate pricing by Country




SAS Certified Specialist: Base Programming Using SAS 9.4

Country/Region Amount Currency
Afghanistan180USD
Aland Islands160EUR
Albania180USD
Algeria160EUR
American Samoa180USD
Andorra180USD
Angola180USD
Anguilla180USD
Antarctica180USD
Antigua and Barbuda180USD
Argentina180USD
Armenia180USD
Aruba180USD
Australia255AUD
Austria 160 EUR
Azerbaijan 180 USD
Bahamas 180USD
Bahrain 115GBP
Bangladesh 180USD
Barbados 180USD
Belarus 180USD
Belgium 160EUR
Belize 180USD
Benin 180USD
Bermuda 180USD
Bhutan 180USD
Bolivia 180USD
Bonaire, Saint Eustatius and Saba180 USD
Bosnia and Herzegowina180USD
Botswana 115GBP
Bouvet Island 180 USD
Brazil 180 USD
British Indian Ocean Territory180 USD
Brunei Darussalam180USD
Bulgaria180USD
Burkina Faso180USD
Burundi180USD
Cambodia180USD
Cameroon160EUR
Canada180USD
Cape Verde180USD
Cayman Islands180USD
Central African Republic 180 USD
Chad 180 USD
Chile 180 USD
China 180 USD
Christmas Island 180 USD
Cocos (Keeling) Islands 180 USD
Democratic Republic of the Congo 180 USD
Republic of the Congo 180 USD
Colombia 180 USD
Comoros 180 USD
Cook Islands 180 USD
Costa Rica 180 USD
Cote D'Ivoire (Ivory Coast) 160 EUR
Croatia 180 USD
Curaçao 180 USD
Cyprus 115 GBP
Czech Republic 180 USD
Denmark 1195 DKK
Djibouti 180 USD
Dominica 180 USD
Dominican Republic 180 USD
East Timor 180 USD
Ecuador 180 USD
Egypt 115 GBP
El Salvador 180 USD
Equatorial Guinea180 USD
Eritrea180 USD
Estonia 180 USD
Ethiopia115 GBP
Falkland Islands180 USD
Faroe Islands180 USD
Fiji255 AUD
Finland160 EUR
France160 EUR
French Guiana180 USD
French Polynesia 180 USD
French Southern Territories 180 USD
Gabon160 EUR
Gambia180 USD
Georgia 180 USD
Germany 160 EUR
Ghana 115 GBP
Gibraltar 180 USD
Greece 160 EUR
Greenland 180 USD
Grenada 180 USD
Guadeloupe 180 USD
Guam 180 USD
Guatemala 180 USD
Guernsey 115 GBP
Guinea 180 USD
Guinea-Bissau 180 USD
Guyana 180 USD
Haiti 180 USD
Heard 180 USD
Honduras 180 USD
Hong Kong 1395 HKD
Hungary 180 USD
Iceland 115 GBP
India 180 USD
Indonesia 180 USD
Iran 180 USD
Iraq 180 USD
Ireland 160 EUR
Isle of Man 115 GBP
Israel 180 USD
Italy 160 EUR
Jamaica180USD
Japan22000JPY
Jersey 115 GBP
Jordan 115 GBP
Kazakhstan 180 USD
Kenya 115 GBP
Kiribati 180 USD
Korea, South 180 USD
Kuwait 115 GBP
Kyrgyzstan 180 USD
Lao 180 USD
Latvia 180 USD
Lebanon 115 GBP
Lesotho 180 USD
Liberia 180 USD
Libyan Arab Jamahiriya 180 USD
Liechtenstein 180 USD
Lithuania 180 USD
Luxembourg 160 EUR
Macau 1395 HKD
Macedonia 180 USD
Madagascar 115 GBP
Malawi 115 GBP
Malaysia180 USD
Maldives180 USD
Mali180 USD
Malta 115 GBP
Marshall Islands 180 USD
Martinique 180 USD
Mauritania 180 USD
Mauritus 115 GBP
Mayotte 180 USD
Mexico 180 USD
Micronesia 180 USD
Moldova 180 USD
Monaco 180 USD
Mongolia 180 USD
Montenegro 180 USD
Montserrat 180 USD
Morocco 160 EUR
Mozambique 180 USD
Myanmar 180 USD
Namibia 115 GBP
Nauru 180 USD
Nepal 180 USD
Netherlands 160 EUR
New Caledonia 255 AUD
New Zealand 280 NZD
Nicaragua 180 USD
Niger 180 USD
Nigeria 115 GBP
Niue 180 USD
Norfolk Island 180 USD
Northern Mariana Islands 180 USD
Norway 1485 NOK
Oman 115 GBP
Pakistan 180 USD
Palau 180 USD
Panama 180 USD
Papua New Guinea 180 USD
Paraguay 180 USD
Palestinian Territory, Occupied 180 USD
Peru 180 USD
Philippines 180 USD
Pitcairn 180 USD
Poland 180 USD
Portugal 160 EUR
Puerto Rico 180 USD
Qatar 115 GBP
Reunion 115 GBP
Romania 180 USD
Russian Federation 180 USD
Rwanda 180 USD
Saint Barthélemy 180 USD
Saint Kitts and Nevis 180 USD
Saint Lucia 180 USD
Saint Martin 180 USD
Samoa 180 USD
San Marino 180 USD
Sao Tome and Principe 180 USD
Saudi Arabia 115 GBP
Senegal 160 EUR
Serbia 180 USD
Seychelles 115 GBP
Sierra Leone 180 USD
Singapore 230 SGD
Sint Maarten 180 USD
Slovakia 180 USD
Slovenia 180 USD
Solomon Islands 180 USD
Somalia 180 USD
South Africa 2450 ZAR
South Georgia 180 USD
Spain 160 EUR
Sri Lanka 180 USD
St. Helena 180 USD
St. Pierre and Miquelon 180 USD
St. Vincent and Grenadines 180 USD
South Sudan 180 USD
Sudan 180 USD
Suriname 180 USD
Svalbard 180 USD
Swaziland 2450 ZAR
Sweden 1505 SEK
Switzerland 175 CHF
Taiwan 180 USD
Tajikistan 180 USD
Tanzania 115 GBP
Thailand 180 USD
Togo 115 GBP
Tokelau 180 USD
Tonga 180 USD
Trinidad and Tobago 180 USD
Tunisia 160 EUR
Turkey 115 GBP
Turkmenistan 180 USD
Turks and Caicos Islands 180 USD
Tuvalu 180 USD
Uganda 180 USD
Ukraine 180 USD
United Arab Emirates 115 GBP
United Kingdom 115 GBP
United States 180 USD
Uruguay 180 USD
US Minor Outlying Islands 180 USD
Uzbekistan 180 USD
Vanuatu 255 AUD
Vatican City State 180 USD
Venezuelav 180USD
Viet Nam 180 USD
Virgin Islands, Britishv 180USD
Virgin Islands, US 180 USD
Wallis and Futuna Islands 180 USD
Western Sahara 180 USD
Yemen 180 USD
Zambia 180 USD
Zimbabwe 115 GBP

Oct 17, 2019

SAS Programming most important tips to remember while coding.


  1. Always check the log after run the job.
  2. Write a comment in each step which can help you or someone who needs to update the code.
  3. Turn on options mprint, mlogic, symbolgen etc when creating macro which helps to debug the issue easily if there any issue.
  4. Try to write a macro if you need to use same code multiple time.
  5. Use KEEP or DROP statement if you are reading big table and you don't want to read all columns.
  6. Subset the data if you don't want everything using WHERE or IF statement.
  7. Always try to execute and check log/result after every step you develop. If you have big job and if it is fail after you run full code then it will be hard to debug. 
  8. if you have any issue or questions contact SAS technical support.