SlideShare una empresa de Scribd logo
1 de 3
PROC CONTENTS
DATA=ATIFRAZA.PRACTICE;
RUN;
PROC MEANS DATA=ATIFRAZA.PRACTICE
NMISS N MEAN STD SKEW KURT MIN MAX
CSS MAXDEC=3;
RUN;
DATA ATIFRAZA.PRACTICE;
SET ATIFRAZA.PRACTICE;
LABEL INVOICE = 'Price';
RUN;
PROC CONTENTS
DATA=ATIFRAZA.PRACTICE;
RUN;
PROC UNIVARIATE
DATA=ATIFRAZA.PRACTICE;
VAR CYLINDERS;
RUN;
PROC MEANS DATA=ATIFRAZA.PRACTICE
NOPRINT;
VAR INVOICE CYLINDERS;
OUTPUT OUT=ATIFRAZA.abc
MAX = MaxInv MaxCyl
MAXID(INVOICE(MODEL)
CYLINDERS(MODEL)) = MaxInvoice
MaxCylinders
MIN = MinInv MinCyl
MINID(INVOICE(MODEL)
CYLINDERS(MODEL)) = MinInvoice
MinCylinders
;
RUN;
PROC PRINT DATA=ATIFRAZA.PRACTICE;
RUN;
PROC FREQ DATA=ATIFRAZA.PRACTICE;
TABLE TYPE*ORIGIN/CHISQ;
TABLE TYPE*ORIGIN/
PLOT=FREQPLOT(TYPE=DOT);
TITLE 'TYPE AND ORIGIN TABLE';
RUN;
PROC FREQ DATA=ATIFRAZA.PRACTICE;
TABLE MAKE ORIGIN;
RUN;
PROC FREQ DATA=ATIFRAZA.PRACTICE;
TABLE MAKE/
PLOT=FREQPLOT(TYPE=DOT);
WEIGHT CYLINDERS;
RUN;
proc print data=atifraza.practice;
run;
PROC FREQ DATA=ATIFRAZA.PRACTICE;
TABLE Type*Origin/CHISQ;
TABLE Type*Origin/
PLOT=FREQPLOT(TYPE=DOT);
WEIGHT INVOICE;
TITLE 'TYPE AND ORIGIN TABLE';
RUN;
PROC UNIVARIATE
DATA=ATIFRAZA.PRACTICE
WINSORIZED=10
TRIMMED=10
ROBUSTSCALE;
VAR CYLINDERS;
RUN;
PROC STDIZE DATA=atifraza.practice
OUT=ATIFRAZA.PRACTICEOK
REPONLY MISSING=MEAN;
VAR CYLINDERS;
BY NOTSORTED TYPE;
RUN;
PROC CORR DATA=atifraza.practiceOK
pearson PLOTS=matriX(HISTOGRAM);
RUN;
/* MERGING TWO TABLES */
data class;
input Name $ 1-25 Year $ 26-34 Major
$ 36-50;
datalines;
Abbott, Jennifer first
Carter, Tom third
Theater
Mendoza, Elissa fourth
Mathematics
Tucker, Rachel first
Uhl, Roland second
Wacenske, Maurice third
Theater
;
run;
proc print data=class;
title 'Acting Class Roster';
run;
data GRADE;
input Name $ 1-25 Year $ 26-34 GRADE
$ 36-50;
datalines;
Abbott, Jenni first
D
Carter, Tom third
T
Mendoza, fourth
M
Tucker, Ra first
A
Uhl, Roland second
B
Wacenske, Maurice third
C
;
run;
proc print data=GRADE;
title 'Acting Class Roster';
run;
proc sort data=class;
by major;
run;
DATA MERGED;
MERGE CLASS(drop=year) GRADE
(drop=year RENAME=(NAME=ndName));
by major;
RUN;
PROC PRINT DATA=MERGED;
RUN;
/* adding engines of only chevrolet
in make using where statement */
proc sort data=ATIFRAZA.PRACTICE
out=WORK.SORTTEMP;
where MAKE='Chevrolet';
;
by Make;
run;
proc print data=WORK.SORTTEMP label;
var Cylinders;
by Make;
sum Cylinders;
run;
proc delete data=work.SORTTEMP;
run;
/* ADDING A NEW VARIABLE WITH THE
HELP OR PREVIOUS VARIABLES ALSO
DROPPING AND RENAMING IN SAME
COMMAND */
DATA DUMMY;
SET ATIFRAZA.PRACTICE
(rename=(Horsepower=HP) DROP=TYPE
MAKE ORIGIN);
AVERAGE=(INVOICE+MSRP)/2;
RUN;
/* CREATING A NEW VARIABLE AND
SETTING ITS VALUE ACCORDING TO SCORE
IN ANOTHER VARIABLE */
DATA TESTOFRANKVARIABLE;
SET ATIFRAZA.PRACTICE;
if CYLINDERS>8 then
STATUS="LARGE";
if CYLINDERS<=8 then
STATUS="MEDIUM";
if CYLINDERS<=6 then
STATUS="SMALL";
if CYLINDERS=. then
STATUS="UNKNOWN";
RUN;
/* TOTAL (MEAN STD) BY CLASS I.E.
TOTAL OF ITEMS BY CLASSES */
proc means data=atifraza.cake;
var PresentScore TasteScore;
class flavor;
output out=Cake_Desc
mean=Avg_PS Avg_TS Std=SD_PS SD_TS
SUM=TOTALPS TOTALTS;
run;
/* SCANNING A VARIABLE AND THEN
PUTTING NAME INVESTED */
DATA ATIFRAZA.MARKS;
INPUT S_NO $ NAME $10. DATE
MMDDYY10. MARKS GRADE $;
FORMAT DATE MMDDYY10.;
DATALINES;
01 ALI RAZA 09122000 80 A
02 AHMED KHAN 02242011 75 B
03 BINA ALI 08302006 60 C
04 MARIA ZIA 07212004 89 A
;
RUN;
DATA ATIFRAZA.MARKS2;
SET ATIFRAZA.MARKS;
F=SCAN(NAME,+1);
L=SCAN(NAME,+2);
NAMES=L||(",")||F;
RUN;

Más contenido relacionado

La actualidad más candente

2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
웅식 전
 
คำสั่ง Do while
คำสั่ง Do whileคำสั่ง Do while
คำสั่ง Do while
kramsri
 
Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivars
Leonardo Soto
 
(Meta 2.3) figura de auto con simbolos dev c++
(Meta 2.3) figura de auto con simbolos dev c++ (Meta 2.3) figura de auto con simbolos dev c++
(Meta 2.3) figura de auto con simbolos dev c++
Eli Diaz
 

La actualidad más candente (18)

2 3. standard io
2 3. standard io2 3. standard io
2 3. standard io
 
Sqlite
SqliteSqlite
Sqlite
 
Fuction call
Fuction callFuction call
Fuction call
 
8.1
8.18.1
8.1
 
Week7
Week7Week7
Week7
 
SLIME
SLIMESLIME
SLIME
 
Avl tree
Avl treeAvl tree
Avl tree
 
คำสั่ง Do while
คำสั่ง Do whileคำสั่ง Do while
คำสั่ง Do while
 
There's more than one way to empty it
There's more than one way to empty itThere's more than one way to empty it
There's more than one way to empty it
 
C program to implement linked list using array abstract data type
C program to implement linked list using array abstract data typeC program to implement linked list using array abstract data type
C program to implement linked list using array abstract data type
 
Bubble Sort
Bubble SortBubble Sort
Bubble Sort
 
Insertion sort
Insertion sortInsertion sort
Insertion sort
 
One dimensional operation of Array in C- language
One dimensional operation of Array in C- language One dimensional operation of Array in C- language
One dimensional operation of Array in C- language
 
Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivars
 
Examples sandhiya class'
Examples sandhiya class'Examples sandhiya class'
Examples sandhiya class'
 
Whole c++
Whole c++Whole c++
Whole c++
 
(Meta 2.3) figura de auto con simbolos dev c++
(Meta 2.3) figura de auto con simbolos dev c++ (Meta 2.3) figura de auto con simbolos dev c++
(Meta 2.3) figura de auto con simbolos dev c++
 
Clauses
ClausesClauses
Clauses
 

Destacado

nextbigthing2014
nextbigthing2014nextbigthing2014
nextbigthing2014
Assaf Guery
 
Pharmacologic principles
Pharmacologic principlesPharmacologic principles
Pharmacologic principles
Umair hanif
 
Becker product training 2011
Becker product training 2011Becker product training 2011
Becker product training 2011
BECKERGPS
 
La estructura genetica de la inteligencia…….
La estructura genetica de la inteligencia…….La estructura genetica de la inteligencia…….
La estructura genetica de la inteligencia…….
Ana Azuela
 
Yana&qnar new year in rome
Yana&qnar new year in romeYana&qnar new year in rome
Yana&qnar new year in rome
87honey
 
Teknologi kumpulan (2) imtiaz
Teknologi kumpulan (2) imtiazTeknologi kumpulan (2) imtiaz
Teknologi kumpulan (2) imtiaz
Haniza Baharudin
 
Eco 202 ch 31 monetary growth and inflation
Eco 202 ch 31 monetary growth and inflationEco 202 ch 31 monetary growth and inflation
Eco 202 ch 31 monetary growth and inflation
Gale Pooley
 
E3Special Cisco-automotive_E.PDF
E3Special Cisco-automotive_E.PDFE3Special Cisco-automotive_E.PDF
E3Special Cisco-automotive_E.PDF
Michael Klemen
 
Eco 202 ch 32 macroeconomics of an open economy
Eco 202 ch 32 macroeconomics of an open economyEco 202 ch 32 macroeconomics of an open economy
Eco 202 ch 32 macroeconomics of an open economy
Gale Pooley
 
101 lecture 21 consumer choice
101 lecture 21 consumer choice101 lecture 21 consumer choice
101 lecture 21 consumer choice
Gale Pooley
 
Kcm 03 10 (1)
Kcm 03 10 (1)Kcm 03 10 (1)
Kcm 03 10 (1)
bweis1
 

Destacado (20)

nextbigthing2014
nextbigthing2014nextbigthing2014
nextbigthing2014
 
Pharmacologic principles
Pharmacologic principlesPharmacologic principles
Pharmacologic principles
 
Becker product training 2011
Becker product training 2011Becker product training 2011
Becker product training 2011
 
Las Vegas
Las VegasLas Vegas
Las Vegas
 
I session short
I session shortI session short
I session short
 
Van Gogh
Van GoghVan Gogh
Van Gogh
 
La estructura genetica de la inteligencia…….
La estructura genetica de la inteligencia…….La estructura genetica de la inteligencia…….
La estructura genetica de la inteligencia…….
 
The Touble With Pine
The Touble With PineThe Touble With Pine
The Touble With Pine
 
Yana&qnar new year in rome
Yana&qnar new year in romeYana&qnar new year in rome
Yana&qnar new year in rome
 
Using a Blog to Promote Academic Writing
Using a Blog to Promote Academic WritingUsing a Blog to Promote Academic Writing
Using a Blog to Promote Academic Writing
 
Teknologi kumpulan (2) imtiaz
Teknologi kumpulan (2) imtiazTeknologi kumpulan (2) imtiaz
Teknologi kumpulan (2) imtiaz
 
Eco 202 ch 31 monetary growth and inflation
Eco 202 ch 31 monetary growth and inflationEco 202 ch 31 monetary growth and inflation
Eco 202 ch 31 monetary growth and inflation
 
E3Special Cisco-automotive_E.PDF
E3Special Cisco-automotive_E.PDFE3Special Cisco-automotive_E.PDF
E3Special Cisco-automotive_E.PDF
 
Eco 202 ch 32 macroeconomics of an open economy
Eco 202 ch 32 macroeconomics of an open economyEco 202 ch 32 macroeconomics of an open economy
Eco 202 ch 32 macroeconomics of an open economy
 
Phyllis Robinson's Speech to the 1959 AAAA Annual Meeting
Phyllis Robinson's Speech to the 1959 AAAA Annual MeetingPhyllis Robinson's Speech to the 1959 AAAA Annual Meeting
Phyllis Robinson's Speech to the 1959 AAAA Annual Meeting
 
101 lecture 21 consumer choice
101 lecture 21 consumer choice101 lecture 21 consumer choice
101 lecture 21 consumer choice
 
Kcm 03 10 (1)
Kcm 03 10 (1)Kcm 03 10 (1)
Kcm 03 10 (1)
 
MFP Dealer Scanning Talk
MFP Dealer Scanning TalkMFP Dealer Scanning Talk
MFP Dealer Scanning Talk
 
Tipping point
Tipping pointTipping point
Tipping point
 
Behandelplannen
BehandelplannenBehandelplannen
Behandelplannen
 

Similar a How to sas (informative codes) COMSATS

PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
Jerome Eteve
 
I have the shell for this program already, I just need the two sub-f.pdf
I have the shell for this program already, I just need the two sub-f.pdfI have the shell for this program already, I just need the two sub-f.pdf
I have the shell for this program already, I just need the two sub-f.pdf
arhamnighty
 
T sql denali code Day of .Net
T sql denali code Day of .NetT sql denali code Day of .Net
T sql denali code Day of .Net
KathiK58
 
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docxMy project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
rosemarybdodson23141
 

Similar a How to sas (informative codes) COMSATS (20)

How to sas codes and tricks
How to sas codes and tricksHow to sas codes and tricks
How to sas codes and tricks
 
SAS CODES AND TRICKS
SAS CODES AND TRICKSSAS CODES AND TRICKS
SAS CODES AND TRICKS
 
SAS codes and tricks Comprehensive all codess
SAS codes and tricks Comprehensive all codessSAS codes and tricks Comprehensive all codess
SAS codes and tricks Comprehensive all codess
 
SAS codes and tricks Comprehensive all codes
SAS codes and tricks Comprehensive all codesSAS codes and tricks Comprehensive all codes
SAS codes and tricks Comprehensive all codes
 
SQL Tuning Overview
SQL Tuning OverviewSQL Tuning Overview
SQL Tuning Overview
 
PerlApp2Postgresql (2)
PerlApp2Postgresql (2)PerlApp2Postgresql (2)
PerlApp2Postgresql (2)
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09
 
Oracle sql tuning
Oracle sql tuningOracle sql tuning
Oracle sql tuning
 
Crushing Data with JavaScript
Crushing Data with JavaScriptCrushing Data with JavaScript
Crushing Data with JavaScript
 
My All Codes of SAS
My All Codes of SASMy All Codes of SAS
My All Codes of SAS
 
I have the shell for this program already, I just need the two sub-f.pdf
I have the shell for this program already, I just need the two sub-f.pdfI have the shell for this program already, I just need the two sub-f.pdf
I have the shell for this program already, I just need the two sub-f.pdf
 
T sql denali code Day of .Net
T sql denali code Day of .NetT sql denali code Day of .Net
T sql denali code Day of .Net
 
JKJ_T SQL project code samples
JKJ_T SQL project code samplesJKJ_T SQL project code samples
JKJ_T SQL project code samples
 
sas aeroplan sample
sas aeroplan samplesas aeroplan sample
sas aeroplan sample
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
Include
IncludeInclude
Include
 
My sql
My sqlMy sql
My sql
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
Oracle
OracleOracle
Oracle
 
My project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docxMy project working well, but there no relationship between the t.docx
My project working well, but there no relationship between the t.docx
 

Último

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

How to sas (informative codes) COMSATS

  • 1. PROC CONTENTS DATA=ATIFRAZA.PRACTICE; RUN; PROC MEANS DATA=ATIFRAZA.PRACTICE NMISS N MEAN STD SKEW KURT MIN MAX CSS MAXDEC=3; RUN; DATA ATIFRAZA.PRACTICE; SET ATIFRAZA.PRACTICE; LABEL INVOICE = 'Price'; RUN; PROC CONTENTS DATA=ATIFRAZA.PRACTICE; RUN; PROC UNIVARIATE DATA=ATIFRAZA.PRACTICE; VAR CYLINDERS; RUN; PROC MEANS DATA=ATIFRAZA.PRACTICE NOPRINT; VAR INVOICE CYLINDERS; OUTPUT OUT=ATIFRAZA.abc MAX = MaxInv MaxCyl MAXID(INVOICE(MODEL) CYLINDERS(MODEL)) = MaxInvoice MaxCylinders MIN = MinInv MinCyl MINID(INVOICE(MODEL) CYLINDERS(MODEL)) = MinInvoice MinCylinders ; RUN; PROC PRINT DATA=ATIFRAZA.PRACTICE; RUN; PROC FREQ DATA=ATIFRAZA.PRACTICE; TABLE TYPE*ORIGIN/CHISQ; TABLE TYPE*ORIGIN/ PLOT=FREQPLOT(TYPE=DOT); TITLE 'TYPE AND ORIGIN TABLE'; RUN; PROC FREQ DATA=ATIFRAZA.PRACTICE; TABLE MAKE ORIGIN; RUN; PROC FREQ DATA=ATIFRAZA.PRACTICE; TABLE MAKE/ PLOT=FREQPLOT(TYPE=DOT); WEIGHT CYLINDERS; RUN; proc print data=atifraza.practice; run; PROC FREQ DATA=ATIFRAZA.PRACTICE; TABLE Type*Origin/CHISQ; TABLE Type*Origin/ PLOT=FREQPLOT(TYPE=DOT); WEIGHT INVOICE; TITLE 'TYPE AND ORIGIN TABLE'; RUN; PROC UNIVARIATE DATA=ATIFRAZA.PRACTICE WINSORIZED=10 TRIMMED=10 ROBUSTSCALE; VAR CYLINDERS; RUN; PROC STDIZE DATA=atifraza.practice OUT=ATIFRAZA.PRACTICEOK REPONLY MISSING=MEAN; VAR CYLINDERS; BY NOTSORTED TYPE; RUN; PROC CORR DATA=atifraza.practiceOK pearson PLOTS=matriX(HISTOGRAM); RUN; /* MERGING TWO TABLES */ data class;
  • 2. input Name $ 1-25 Year $ 26-34 Major $ 36-50; datalines; Abbott, Jennifer first Carter, Tom third Theater Mendoza, Elissa fourth Mathematics Tucker, Rachel first Uhl, Roland second Wacenske, Maurice third Theater ; run; proc print data=class; title 'Acting Class Roster'; run; data GRADE; input Name $ 1-25 Year $ 26-34 GRADE $ 36-50; datalines; Abbott, Jenni first D Carter, Tom third T Mendoza, fourth M Tucker, Ra first A Uhl, Roland second B Wacenske, Maurice third C ; run; proc print data=GRADE; title 'Acting Class Roster'; run; proc sort data=class; by major; run; DATA MERGED; MERGE CLASS(drop=year) GRADE (drop=year RENAME=(NAME=ndName)); by major; RUN; PROC PRINT DATA=MERGED; RUN; /* adding engines of only chevrolet in make using where statement */ proc sort data=ATIFRAZA.PRACTICE out=WORK.SORTTEMP; where MAKE='Chevrolet'; ; by Make; run; proc print data=WORK.SORTTEMP label; var Cylinders; by Make; sum Cylinders; run; proc delete data=work.SORTTEMP; run; /* ADDING A NEW VARIABLE WITH THE HELP OR PREVIOUS VARIABLES ALSO DROPPING AND RENAMING IN SAME COMMAND */ DATA DUMMY; SET ATIFRAZA.PRACTICE (rename=(Horsepower=HP) DROP=TYPE MAKE ORIGIN); AVERAGE=(INVOICE+MSRP)/2; RUN; /* CREATING A NEW VARIABLE AND SETTING ITS VALUE ACCORDING TO SCORE IN ANOTHER VARIABLE */ DATA TESTOFRANKVARIABLE; SET ATIFRAZA.PRACTICE; if CYLINDERS>8 then STATUS="LARGE";
  • 3. if CYLINDERS<=8 then STATUS="MEDIUM"; if CYLINDERS<=6 then STATUS="SMALL"; if CYLINDERS=. then STATUS="UNKNOWN"; RUN; /* TOTAL (MEAN STD) BY CLASS I.E. TOTAL OF ITEMS BY CLASSES */ proc means data=atifraza.cake; var PresentScore TasteScore; class flavor; output out=Cake_Desc mean=Avg_PS Avg_TS Std=SD_PS SD_TS SUM=TOTALPS TOTALTS; run; /* SCANNING A VARIABLE AND THEN PUTTING NAME INVESTED */ DATA ATIFRAZA.MARKS; INPUT S_NO $ NAME $10. DATE MMDDYY10. MARKS GRADE $; FORMAT DATE MMDDYY10.; DATALINES; 01 ALI RAZA 09122000 80 A 02 AHMED KHAN 02242011 75 B 03 BINA ALI 08302006 60 C 04 MARIA ZIA 07212004 89 A ; RUN; DATA ATIFRAZA.MARKS2; SET ATIFRAZA.MARKS; F=SCAN(NAME,+1); L=SCAN(NAME,+2); NAMES=L||(",")||F; RUN;