Documente Academic
Documente Profesional
Documente Cultură
sas
data Universitati ;
infile '/home/u47449065/ProiectISAD/Universitati.txt' dlm =';';
length NUME_UNIVERSITATE $ 60
ORAS $ 20;
input ID_UNIVERSITATE NUME_UNIVERSITATE $ ORAS $ NUMAR_FACULTATI NUMAR_STUDENTI LOC_TOP;
run;
data Facultati;
infile '/home/u47449065/ProiectISAD/Facultati.txt' dlm =';';
length DENUMIRE $ 90;
input ID_FACULTATE DENUMIRE $ NUMAR_STUDENTI LOCURI_BUGET ID_UNIVERSITATE;
run;
*3. Crearea unor subseturi de date folosind clauza WHERE si instructiunea IF;
data Bune;
set exemple.Universitati;
where LOC_TOP gt 5 and LOC_TOP le 10 ;
run;
data Mediocre;
set exemple.Universitati;
where LOC_TOP gt 10;
run;
PROC PRINT DATA=Mediocre;
1/4
6/5/2021 Code: Proiect ISAD.sas
NUMAR_STUDENTI is NULL or
LOC_TOP not gt 0 or
LOC_TOP is NULL;
title "Valori in afara limitelor pentru Universitati";
ID ID_UNIVERSITATE;
Var NUMAR_FACULTATI NUMAR_STUDENTI LOC_TOP;
run;
data Facultati_sterse;
set Facultati;
if missing(ID_FACULTATE) or missing(NUMAR_STUDENTI) or missing(LOCURI_BUGET)then delete;
run;
proc print data=facultati_sterse;
data Universitati_filtrate;
set Universitati;
if missing (ID_UNIVERSITATE) or missing (NUME_UNIVERSITATE) or missing (NUMAR_FACULTATI)then delete;
run;
PROC PRINT DATA = UNIVERSITATI_FILTRATE;
data universitati_sterse;
set universitati_filtrate;
if NUMAR_FACULTATI not gt 0 or NUMAR_STUDENTI not gt 0 or LOC_TOP not gt 0 then delete;
run;
PROC PRINT DATA=UNIVERSITATI_STERSE;
data duplicat;
merge frecvente (in=IND where = (count>1) keep = ID_UNIVERSITATE count) UNIVERSITATI_SORT (in=INP);
by ID_UNIVERSITATE;
if IND and INP;
drop count;
run;
PROC PRINT DATA=duplicat;
2/4
6/5/2021 Code: Proiect ISAD.sas
proc sort data=Facultati out=FACULTATI_SORT;
by ID_FACULTATE;
run;
data duplicatf;
merge frecvente (in=IND where = (count>1) keep = ID_FACULTATE count) FACULTATI_SORT (in=INP);
by ID_FACULTATE;
if IND and INP;
drop count;
run;
DATA Universitati;
INPUT ID_UNIVERSITATE NUMAR_STUDENTI;
DATALINES;
120 3300
121 56000
122 30000
;
RUN;
DATA Facultati;
INPUT ID_UNIVERSITATE NUMAR_STUDENTI DENUMIRE $;
DATALINES;
123 25000 Litere
124 15000 Sport
125 40000 Muzica
;
RUN;
data interclasare;
set Universitati Facultati;
by ID_UNIVERSITATE;
RUN;
PROC PRINT DATA = interclasare;
PROC SQL;
CREATE TABLE Top_5 as
SELECT NUME_UNIVERSITATE, LOC_TOP
FROM Universitati
WHERE LOC_TOP <5 and LOC_TOP >0
GROUP BY ID_UNIVERSITATE
;
QUIT;
data IstoricUniversitati ;
infile '/home/u47449065/ProiectISAD/IstoricUniversitati.txt' dlm =';';
length NUME_UNIVERSITATE $ 60;
input ID_UNIVERSITATE NUME_UNIVERSITATE $ NUMAR_STUDENTI AN;
run;
3/4
6/5/2021 Code: Proiect ISAD.sas
run;
data istoric_agregare;
set istoric_transpus;
media_studentilor=mean(of STUDENTI2019-STUDENTI2021);
deviatia_studentilor=std(of STUDENTI2019-STUDENTI2021);
mediana_studentilor=median(of STUDENTI2019-STUDENTI2021);
run;
proc print data=istoric_agregare;
4/4