# 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;
```