markdown SAS规则

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown SAS规则相关的知识,希望对你有一定的参考价值。

# SAS rules

## Case sensitive

SAS in not case sensitive.

```sas
proC PrinT daTa = woRK.IntrO;
WHerE Rating = 2;
run;
```

SAS is case sensitive while comparing.

```sas
proc print data = work.InTro;
where rating = 2;
run;
```

## Spaces don't matter

```sas
proc print data = work.intro; where rating =2; run     ;
```

## Variables in SAS

```sas
proc print data = work.intro;
where rating = 2;
run;

\\rating is a variable here
```


## Work library

Work is the default library. 


```sas
data test5;
input x y p q;
datalines;
1 2 55
3 4 77
5 6 99
7 8 33
9    10 44
;
run;

proc print data = test5;
run;
```


## Data step 
 
```sas 
data work.test;
x=12;
y=34;
z= 35;
run;
```

## Proc step

```sas
proc print data = work.test;
run;
```

## Data types in SAS

There are only two datatypes in SAS. **char** and **numbers**. 

Characters end with a dollar sign. 

```sas
data work.test9;
input name$ age salary;
datalines;
a 23 442323
b 43 23423423
c 32 4242443
d 44 3242424
;
run;

proc print data = work.test9;
run;
```

Can't perform numeric operations on characters. 


# Comma is usually not required


# Comments in SAS

There are two ways to mention comments in SAS

```sas
* class post;
* semicolon is needed;
```

```sas
/*  class post; */
```

以上是关于markdown SAS规则的主要内容,如果未能解决你的问题,请参考以下文章

markdown SAS中的频率

markdown 在SAS中计算平均值

markdown SAS中的排序功能

markdown 在SAS中创建/导入数据

markdown 在SAS中打印

SAS Base - 关联规则矩阵