Professional Documents
Culture Documents
Sas Master Avinash
Sas Master Avinash
Sas Master Avinash
2.dbms means data base management system it tell what type of data you are dealing with either csv txt
Ex if you have a raw data nitish ,2000,26,52 then dbms=csv as there is comma separated files
Delimiter or spaces given between records to keep each variable in specified column.
Dlm=dsd=,(comma).
EX-data employees;
infile datalines dlm='.'dsd ;
input name$ age salary tax;
rename tax=fuck;
cards;
avin...15. 2000. 5.6
keshri... 14. 4000.2.1
sonam. 21.. 20000. 2.3
keshri. 22. 50000. 4.5
;
run;
proc print data=employees;
TITLE "WORK RADIO SURVEY";
RUN;
DIFFERENCE BETWEEN DSD AND DLM.:-1.dsd helps in reading missing value.2-DSD IS USED WHEN
THERE IS MISSING VALUES IN COLUMN .IT HELPS IN FILTERING NAME WITH QUOTATION MARK EX-
“JOHN”.IT READS TWO CONSECUTIVE DELIMETER AS MISSING VALUES.
Proc import datafile=’file name’ out-to give your own name dbms=csv
3.IT DOESN’T MATTER HOW MANY DELIMETER IS THERE IN BETWEEN TWO VALUES BUT DELIMITER
SHOULD BE SAME.
Comments are used .* and it shud end with ; or /*** and end with ****/
Ex data students ;
input age gender $ marks;
rename age=height ; /***i purposefully changed it ***/
datalines;
5.4 Male 25
6 Female 26
5.1 Female 21
;
run;
proc print data=students;
run;
name=john
to rread this we
1.interactive wizard
2.proc import .
SAS MASTER AVINASH
Basic information
Form of program
1. Data trail; here semicolon acts as a statement terminator if not use it will consider it as data
2. Length gender$ 15; 15 is number of characters it consider. Number is entered up to 12 after that it
will consider in decimal points
4. Datalines;
100 20 male
200 30 female
300 6 male
Run;
5._null_ data files will not be created hence sas memory will save ex data _nulls_;
Sas data set is tabular form with rows having observations and column contains and variables.
Sas program consists of two steps –data steps and proc steps
Proc steps consists of performing statistical analysis method after which print is done
Input-this code follows the rows element under which you want to put values
Datalines-this code will reads your values that’s gonna come in columns
$-it is before character values to tell sas that character names will come under this ex –input age cost
gender $ where dollar sign tell that character values come under gender not numerics.sas cannot
recognize characters.
Length-
Set
If –To differ datas on the base of characters it may be gender wise or number wise ex if Gender=”Male”;
Input data
Datalines;
Proc print data = trail; it gives your program output where proc means procedure.
Run;
Proc content data=trail; it gives you information when the contents was created etc information.
Run;
Proc freq data=trail; freq code will calculate the number of males or females or etc.
Run;
Proc Gchart data=trail; this codes gives a brief preview of your program in the form of graph
Vbar3d gender;
Run;
data list;
datalines;
john 12 male
run
What if john jhonsan to be consider like this then use input name:& 20. Age gender$ where and sign is
ampercent that considers name with blank space.
2. Column input method-in column input method there is no particular order of writing values under
datalines ex
data col;
datalines;
21 john male- #here values not mentioned according to the input values.
3. Formatted input method-no need to give column position .here we give character position
Ex –input @10 name$ 12. Here@10 says from where the character values start and 12 says ending
character.
Ex data format;
Ex data named;
Datalines;
Name=john age=40 gender=male;
5. Output data.
Data out;