- Open Enterprise Guide 8.1
- Click Tools menu then select Options
- Select General on left then in Color Theme under Visual Experience choose Ignite(Dark).
SAS and DataFlux Programming
SAS Programming and DataFlux EEL
Jan 8, 2020
Enable dark mode in SAS Enterprise Guide 8.1
Jan 7, 2020
How to read 2-digit year properly with YEARCUTOFF SAS options
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.
- 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.
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
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.
- where number >= 10;>
- where createDate>='01jan2010'd and createTime>='8:00't;
- where countryCode='US';
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.
- Start with * (asterisk) and end with ; (semi colon).
- Start with /* and end with */.
Shortcut - CTRL+/ to comment, CTRL+SHIFT+/ to uncomment.
This way you can comment only one line. You can write anything in this place. Example: *This is comment;
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 |
---|---|---|
Afghanistan | 180 | USD |
Aland Islands | 160 | EUR |
Albania | 180 | USD |
Algeria | 160 | EUR |
American Samoa | 180 | USD |
Andorra | 180 | USD |
Angola | 180 | USD |
Anguilla | 180 | USD |
Antarctica | 180 | USD |
Antigua and Barbuda | 180 | USD |
Argentina | 180 | USD |
Armenia | 180 | USD |
Aruba | 180 | USD |
Australia | 255 | AUD |
Austria | 160 | EUR |
Azerbaijan | 180 | USD |
Bahamas | 180 | USD |
Bahrain | 115 | GBP |
Bangladesh | 180 | USD |
Barbados | 180 | USD |
Belarus | 180 | USD |
Belgium | 160 | EUR |
Belize | 180 | USD |
Benin | 180 | USD |
Bermuda | 180 | USD |
Bhutan | 180 | USD |
Bolivia | 180 | USD |
Bonaire, Saint Eustatius and Saba | 180 | USD |
Bosnia and Herzegowina | 180 | USD |
Botswana | 115 | GBP |
Bouvet Island | 180 | USD |
Brazil | 180 | USD |
British Indian Ocean Territory | 180 | USD |
Brunei Darussalam | 180 | USD |
Bulgaria | 180 | USD |
Burkina Faso | 180 | USD |
Burundi | 180 | USD |
Cambodia | 180 | USD |
Cameroon | 160 | EUR |
Canada | 180 | USD |
Cape Verde | 180 | USD |
Cayman Islands | 180 | USD |
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 Guinea | 180 | USD |
Eritrea | 180 | USD |
Estonia | 180 | USD |
Ethiopia | 115 | GBP |
Falkland Islands | 180 | USD |
Faroe Islands | 180 | USD |
Fiji | 255 | AUD |
Finland | 160 | EUR |
France | 160 | EUR |
French Guiana | 180 | USD |
French Polynesia | 180 | USD |
French Southern Territories | 180 | USD |
Gabon | 160 | EUR |
Gambia | 180 | 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 |
Jamaica | 180 | USD |
Japan | 22000 | JPY |
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 |
Malaysia | 180 | USD |
Maldives | 180 | USD |
Mali | 180 | 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 | 180 | USD |
Viet Nam | 180 | USD |
Virgin Islands, Britishv | 180 | USD |
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.
- Always check the log after run the job.
- Write a comment in each step which can help you or someone who needs to update the code.
- Turn on options mprint, mlogic, symbolgen etc when creating macro which helps to debug the issue easily if there any issue.
- Try to write a macro if you need to use same code multiple time.
- Use KEEP or DROP statement if you are reading big table and you don't want to read all columns.
- Subset the data if you don't want everything using WHERE or IF statement.
- 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.
- if you have any issue or questions contact SAS technical support.