markdown 在SAS中打印

Posted

tags:

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

# Printing a dataset

```sas
proc print data = d1;
run;
```

# Printing only one variable

```sas
proc print data = d1;
var a;
run;
```

# Printing observations in SAS


Printing without observations

```sas
proc print data = work.test2 noobs;
run;
```

Defines last observations

```sas
proc print data = work.test2(obs=7);
run;
```

Defines first observation

```sas
proc print data = work.test2(obs=7);
run;
```

Defines first and last observation

```sas
proc print data = work.test2(firstobs=3 obs=7);
run;
```


## Defining length of a variable

#### Alignment needed.Do not use if the data is not aligned. 

```sas
data test;
input name$1-10 age salary;
datalines;
ak das 23 23432432432;
bk sharma 24 234324234;
ck verma 31 2343290923;
dk gupta 12 2343242;
run;
```

Here it will not work fine. 

##### Can be used at multiple places

```sas
data test;
input name$1-10 age13-14 salary14-18;
datalines;
...
...
...
...
run;
```

#### Placement of the numbers doesn't matter. Can be moved around. 

```sas
data test;
input name$1-10 salary14-15 age 13-14;
datalines;
...
...
...
...
run;
```

#### Possible to create another variable from existing variables. 

```sas
data test;
input name$1-10 firstname$1-5 lastname$6-10 age salary;
datalines;
...
...
...
...
run;
```

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

markdown 在SAS中创建/导入数据

markdown SAS的全球声明

markdown SAS中的频率

markdown SAS中的排序功能

markdown SAS规则

在LOCAL驱动器上打印日志到表或文本文件