370.ASTRONAUT PERFORMANCE & SPACE MISSION ANALYTICS USING SAS
ASTRONAUT PERFORMANCE & SPACE MISSION ANALYTICS USING SAS
HERE IN THIS PROJECT WE USED THESE SAS STATEMENTS --PROC SQL | PROC MEANS | PROC SORT | PROC SGPLOT | MACROS | MDY | INTNX | INTCK | MERGE | APPEND | SET | TRANSPOSE
1. Why Astronaut Data Analytics Matters
Modern
space agencies such as NASA, ESA, ISRO, Roscosmos and SpaceX manage billions
of dollars of missions.
Each
astronaut is a high-value human asset. Their:
- Mission count
- Space exposure
- Age
- Success rate
- Fatigue
- Flight history
must be continuously
analyzed to ensure:
- Crew safety
- Optimal mission selection
- Training effectiveness
- Mission success
SAS is
used in aerospace organizations because it can:
- Merge flight logs
- Calculate exposure time
- Rank crew members
- Predict performance
- Create mission dashboards
This
project simulates how NASA or ISRO would track astronaut performance
using SAS.
2. Creating Astronaut Master Dataset
This Astronaut Analytics project is not just about space data. It is a complete enterprise-level SAS training model
that teaches how real organizations (NASA, ISRO, SpaceX, ESA) analyze human performance, operational risk, and mission
efficiency using SAS.
You are learning how raw data becomes management decisions.
data astronauts_raw;
format First_Mission Last_Mission date9.;
input Name $ Country $ Missions Total_Hours_in_Space Age Success_Rate First_Mission :date9. Last_Mission :date9.;
datalines;
John_USA USA 6 1240 45 92 01JAN2010 15DEC2024
Maria_RUS Russia 7 1400 48 95 10FEB2008 20NOV2024
Ravi_IND India 4 800 38 88 05MAR2015 01JUN2024
Li_CHN China 5 900 40 90 20APR2013 10OCT2024
Akira_JPN Japan 3 620 36 85 11MAY2017 15AUG2024
Tom_USA USA 8 1600 50 97 01JAN2005 30DEC2024
Elena_RUS Russia 6 1300 46 93 01JUN2011 20DEC2024
Ahmed_UAE UAE 2 300 34 80 10MAR2021 05APR2024
Paul_FRA France 4 700 39 87 12JUL2016 01SEP2024
Mark_USA USA 5 1000 42 90 02FEB2014 18DEC2024
Sun_CHN China 6 1200 44 94 01JAN2012 22DEC2024
Anita_IND India 3 500 35 82 15JUN2018 30SEP2024
Leo_ITA Italy 4 750 41 89 10APR2016 10OCT2024
Carlos_ESP Spain 3 620 37 86 01MAR2017 12SEP2024
James_USA USA 7 1450 49 96 01JAN2007 31DEC2024
Ivan_RUS Russia 5 1100 43 91 01APR2012 15NOV2024
;
run;
proc print data=astronauts_raw;
run;
OUTPUT:
| Obs | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate |
|---|---|---|---|---|---|---|---|---|
| 1 | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 |
| 2 | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 |
| 3 | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 |
| 4 | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 |
| 5 | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 |
| 6 | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 |
| 7 | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 |
| 8 | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 |
| 9 | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 |
| 10 | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 |
| 11 | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 |
| 12 | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 |
| 13 | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 |
| 14 | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 |
| 15 | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 |
| 16 | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 |
3. Creating Space Exposure Dates using INTNX & MDY
data astronauts_dates;
set astronauts_raw;
Mission_Start = intnx('month', First_Mission, 0, 'b');
Mission_End = intnx('month', Last_Mission, 0, 'e');
Mission_Year = year(First_Mission);
format Mission_Start Mission_End date9.;
run;
proc print data=astronauts_dates;
run;
OUTPUT:
| Obs | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 |
| 2 | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 |
| 3 | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 |
| 4 | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 |
| 5 | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 |
| 6 | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 |
| 7 | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 |
| 8 | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 |
| 9 | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 |
| 10 | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 |
| 11 | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 |
| 12 | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 |
| 13 | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 |
| 14 | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 |
| 15 | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 |
| 16 | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 |
4. Experience Duration Using INTCK
data astronauts_exp;
set astronauts_dates;
Years_of_Service = intck('year', First_Mission, Last_Mission);
run;
proc print data=astronauts_exp;
run;
OUTPUT:
| Obs | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 |
| 2 | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 |
| 3 | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 |
| 4 | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 |
| 5 | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 |
| 6 | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 |
| 7 | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 |
| 8 | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 |
| 9 | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 |
| 10 | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 |
| 11 | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 |
| 12 | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 |
| 13 | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 |
| 14 | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 |
| 15 | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 |
| 16 | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 |
5. Macro for Performance Classification
%macro classify;
data astronauts_ranked;
set astronauts_exp;
if Success_Rate >= 95 then Success_Level = "ELITE";
else if Success_Rate >= 90 then Success_Level = "HIGH";
else if Success_Rate >= 85 then Success_Level = "MEDIUM";
else Success_Level = "LOW";
run;
proc print data=astronauts_ranked;
run;
%mend;
%classify;
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 |
| 2 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 |
| 3 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 |
| 4 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 |
| 5 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 |
| 6 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 |
| 7 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 |
| 8 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 |
| 9 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 |
| 10 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 |
| 11 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 |
| 12 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 |
| 13 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 |
| 14 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 |
| 15 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 |
| 16 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 |
6. Sorting Astronauts by Space Hours
proc sort data=astronauts_ranked out=astronauts_sorted;
by descending Total_Hours_in_Space;
run;
proc print data=astronauts_sorted;
run;
Space agencies always want the most experienced astronauts at the top.
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 |
| 2 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 |
| 3 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 |
| 4 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 |
| 5 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 |
| 6 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 |
| 7 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 |
| 8 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 |
| 9 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 |
| 10 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 |
| 11 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 |
| 12 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 |
| 13 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 |
| 14 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 |
| 15 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 |
| 16 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 |
7. PROC SQL – Mission Analytics
proc sql;
create table country_stats as
select Country,
count(Name) as Astronauts,
avg(Total_Hours_in_Space) as Avg_Hours,
avg(Success_Rate) as Avg_Success
from astronauts_sorted
group by Country;
quit;
proc print data=country_stats;
run;
This shows how each country performs in space.
OUTPUT:
| Obs | Country | Astronauts | Avg_Hours | Avg_Success |
|---|---|---|---|---|
| 1 | China | 2 | 1050.00 | 92.00 |
| 2 | France | 1 | 700.00 | 87.00 |
| 3 | India | 2 | 650.00 | 85.00 |
| 4 | Italy | 1 | 750.00 | 89.00 |
| 5 | Japan | 1 | 620.00 | 85.00 |
| 6 | Russia | 3 | 1266.67 | 93.00 |
| 7 | Spain | 1 | 620.00 | 86.00 |
| 8 | UAE | 1 | 300.00 | 80.00 |
| 9 | USA | 4 | 1322.50 | 93.75 |
8. PROC MEANS – Performance Summary
proc means data=astronauts_sorted mean min max;
var Total_Hours_in_Space Missions Age Success_Rate;
run;
OUTPUT:
The MEANS Procedure
| Variable | Mean | Minimum | Maximum |
|---|---|---|---|
Total_Hours_in_Space Missions Age Success_Rate | 967.5000000 4.8750000 41.6875000 89.6875000 | 300.0000000 2.0000000 34.0000000 80.0000000 | 1600.00 8.0000000 50.0000000 97.0000000 |
NASA would use this to track:
· Crew fatigue
· Average experience knowing
· Age distributions
9. PROC SGPLOT – Visual Performance Dashboard
proc sgplot data=astronauts_sorted;
vbar Name / response=Total_Hours_in_Space;
title "Astronaut Space Experience Comparison";
run;
OUTPUT:
proc sgplot data=astronauts_sorted;
scatter x=Age y=Success_Rate;
title "Age vs Mission Success";
run;
This helps identify optimal astronaut age vs performance.
OUTPUT:
10. TRANSPOSE – Convert Data for Reports
proc transpose data=astronauts_sorted out=hours_wide;
id Name;
var Total_Hours_in_Space;
run;
proc print data=hours_wide;
run;
Now every astronaut becomes a column for reporting.
OUTPUT:
| Obs | _NAME_ | Tom_USA | James_US | Maria_RU | Elena_RU | John_USA | Sun_CHN | Ivan_RUS | Mark_USA | Li_CHN | Ravi_IND | Leo_ITA | Paul_FRA | Akira_JP | Carlos_E | Anita_IN | Ahmed_UA |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Total_Hours_in_Space | 1600 | 1450 | 1400 | 1300 | 1240 | 1200 | 1100 | 1000 | 900 | 800 | 750 | 700 | 620 | 620 | 500 | 300 |
11. MERGE – Combine Country Statistics
proc sort data=astronauts_sorted; by Country; run;
proc print data=astronauts_sorted;
run;
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 |
| 2 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 |
| 3 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 |
| 4 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 |
| 5 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 |
| 6 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 |
| 7 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 |
| 8 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 |
| 9 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 |
| 10 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 |
| 11 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 |
| 12 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 |
| 13 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 |
| 14 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 |
| 15 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 |
| 16 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 |
proc sort data=country_stats; by Country; run;
proc print data=country_stats;
run;
OUTPUT:
| Obs | Country | Astronauts | Avg_Hours | Avg_Success |
|---|---|---|---|---|
| 1 | China | 2 | 1050.00 | 92.00 |
| 2 | France | 1 | 700.00 | 87.00 |
| 3 | India | 2 | 650.00 | 85.00 |
| 4 | Italy | 1 | 750.00 | 89.00 |
| 5 | Japan | 1 | 620.00 | 85.00 |
| 6 | Russia | 3 | 1266.67 | 93.00 |
| 7 | Spain | 1 | 620.00 | 86.00 |
| 8 | UAE | 1 | 300.00 | 80.00 |
| 9 | USA | 4 | 1322.50 | 93.75 |
data final_astronauts;
merge astronauts_sorted country_stats;
by Country;
run;
proc print data=final_astronauts;
run;
Now every astronaut also carries national performance metrics.
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service | Astronauts | Avg_Hours | Avg_Success |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 | 2 | 1050.00 | 92.00 |
| 2 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 | 2 | 1050.00 | 92.00 |
| 3 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 | 1 | 700.00 | 87.00 |
| 4 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 | 2 | 650.00 | 85.00 |
| 5 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 | 2 | 650.00 | 85.00 |
| 6 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 | 1 | 750.00 | 89.00 |
| 7 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 | 1 | 620.00 | 85.00 |
| 8 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 | 3 | 1266.67 | 93.00 |
| 9 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 | 3 | 1266.67 | 93.00 |
| 10 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 | 3 | 1266.67 | 93.00 |
| 11 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 | 1 | 620.00 | 86.00 |
| 12 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 | 1 | 300.00 | 80.00 |
| 13 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 | 4 | 1322.50 | 93.75 |
| 14 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 | 4 | 1322.50 | 93.75 |
| 15 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 | 4 | 1322.50 | 93.75 |
| 16 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 | 4 | 1322.50 | 93.75 |
12. APPEND – Add New Astronauts
data new_astronaut;
input Name $ Country $ Missions Total_Hours_in_Space Age Success_Rate;
datalines;
Neil_USA USA 2 350 34 85
;
run;
proc print data=new_astronaut;
run;
OUTPUT:
| Obs | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate |
|---|---|---|---|---|---|---|
| 1 | Neil_USA | USA | 2 | 350 | 34 | 85 |
proc append base=final_astronauts
data=new_astronaut force;
run;
proc print data=final_astronauts;
run;
This simulates onboarding of new astronauts.
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service | Astronauts | Avg_Hours | Avg_Success |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 | 2 | 1050.00 | 92.00 |
| 2 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 | 2 | 1050.00 | 92.00 |
| 3 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 | 1 | 700.00 | 87.00 |
| 4 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 | 2 | 650.00 | 85.00 |
| 5 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 | 2 | 650.00 | 85.00 |
| 6 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 | 1 | 750.00 | 89.00 |
| 7 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 | 1 | 620.00 | 85.00 |
| 8 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 | 3 | 1266.67 | 93.00 |
| 9 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 | 3 | 1266.67 | 93.00 |
| 10 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 | 3 | 1266.67 | 93.00 |
| 11 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 | 1 | 620.00 | 86.00 |
| 12 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 | 1 | 300.00 | 80.00 |
| 13 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 | 4 | 1322.50 | 93.75 |
| 14 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 | 4 | 1322.50 | 93.75 |
| 15 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 | 4 | 1322.50 | 93.75 |
| 16 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 | 4 | 1322.50 | 93.75 |
| 17 | . | . | Neil_USA | USA | 2 | 350 | 34 | 85 | . | . | . | . | . | . | . |
13. SET – Combine Old and New Records
data all_astronauts;
set final_astronauts
new_astronaut;
run;
proc print data=all_astronauts;
run;
OUTPUT:
| Obs | SUCCESS_LEVEL | First_Mission | Last_Mission | Name | Country | Missions | Total_Hours_in_Space | Age | Success_Rate | Mission_Start | Mission_End | Mission_Year | Years_of_Service | Astronauts | Avg_Hours | Avg_Success |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | HIGH | 01JAN2012 | 22DEC2024 | Sun_CHN | China | 6 | 1200 | 44 | 94 | 01JAN2012 | 31DEC2024 | 2012 | 12 | 2 | 1050.00 | 92.00 |
| 2 | HIGH | 20APR2013 | 10OCT2024 | Li_CHN | China | 5 | 900 | 40 | 90 | 01APR2013 | 31OCT2024 | 2013 | 11 | 2 | 1050.00 | 92.00 |
| 3 | MEDIUM | 12JUL2016 | 01SEP2024 | Paul_FRA | France | 4 | 700 | 39 | 87 | 01JUL2016 | 30SEP2024 | 2016 | 8 | 1 | 700.00 | 87.00 |
| 4 | MEDIUM | 05MAR2015 | 01JUN2024 | Ravi_IND | India | 4 | 800 | 38 | 88 | 01MAR2015 | 30JUN2024 | 2015 | 9 | 2 | 650.00 | 85.00 |
| 5 | LOW | 15JUN2018 | 30SEP2024 | Anita_IN | India | 3 | 500 | 35 | 82 | 01JUN2018 | 30SEP2024 | 2018 | 6 | 2 | 650.00 | 85.00 |
| 6 | MEDIUM | 10APR2016 | 10OCT2024 | Leo_ITA | Italy | 4 | 750 | 41 | 89 | 01APR2016 | 31OCT2024 | 2016 | 8 | 1 | 750.00 | 89.00 |
| 7 | MEDIUM | 11MAY2017 | 15AUG2024 | Akira_JP | Japan | 3 | 620 | 36 | 85 | 01MAY2017 | 31AUG2024 | 2017 | 7 | 1 | 620.00 | 85.00 |
| 8 | ELITE | 10FEB2008 | 20NOV2024 | Maria_RU | Russia | 7 | 1400 | 48 | 95 | 01FEB2008 | 30NOV2024 | 2008 | 16 | 3 | 1266.67 | 93.00 |
| 9 | HIGH | 01JUN2011 | 20DEC2024 | Elena_RU | Russia | 6 | 1300 | 46 | 93 | 01JUN2011 | 31DEC2024 | 2011 | 13 | 3 | 1266.67 | 93.00 |
| 10 | HIGH | 01APR2012 | 15NOV2024 | Ivan_RUS | Russia | 5 | 1100 | 43 | 91 | 01APR2012 | 30NOV2024 | 2012 | 12 | 3 | 1266.67 | 93.00 |
| 11 | MEDIUM | 01MAR2017 | 12SEP2024 | Carlos_E | Spain | 3 | 620 | 37 | 86 | 01MAR2017 | 30SEP2024 | 2017 | 7 | 1 | 620.00 | 86.00 |
| 12 | LOW | 10MAR2021 | 05APR2024 | Ahmed_UA | UAE | 2 | 300 | 34 | 80 | 01MAR2021 | 30APR2024 | 2021 | 3 | 1 | 300.00 | 80.00 |
| 13 | ELITE | 01JAN2005 | 30DEC2024 | Tom_USA | USA | 8 | 1600 | 50 | 97 | 01JAN2005 | 31DEC2024 | 2005 | 19 | 4 | 1322.50 | 93.75 |
| 14 | ELITE | 01JAN2007 | 31DEC2024 | James_US | USA | 7 | 1450 | 49 | 96 | 01JAN2007 | 31DEC2024 | 2007 | 17 | 4 | 1322.50 | 93.75 |
| 15 | HIGH | 01JAN2010 | 15DEC2024 | John_USA | USA | 6 | 1240 | 45 | 92 | 01JAN2010 | 31DEC2024 | 2010 | 14 | 4 | 1322.50 | 93.75 |
| 16 | HIGH | 02FEB2014 | 18DEC2024 | Mark_USA | USA | 5 | 1000 | 42 | 90 | 01FEB2014 | 31DEC2024 | 2014 | 10 | 4 | 1322.50 | 93.75 |
| 17 | . | . | Neil_USA | USA | 2 | 350 | 34 | 85 | . | . | . | . | . | . | . | |
| 18 | . | . | Neil_USA | USA | 2 | 350 | 34 | 85 | . | . | . | . | . | . | . |
14. What This Project Simulates in Real Life
This project mirrors how:
·
NASA
tracks crew readiness
·
ISRO
tracks Gaganyaan astronauts
·
ESA
evaluates international partners
·
SpaceX
picks long-duration crews
1. DATA ENGINEERING SKILLS YOU LEARN
We learned how to build structured datasets from scratch using
SAS.
You practiced:
|
Skill |
What
it means in real life |
|
DATA Step |
Creating astronaut master records |
|
SET |
Combining multiple astronaut tables |
|
APPEND |
Adding new astronauts |
|
MERGE |
Linking astronaut data with country stats |
|
TRANSPOSE |
Converting rows to columns for reporting |
These are the same techniques used in:
·
Clinical trials
·
Banking risk systems
·
Aerospace crew management
·
HR analytics
We are no longer just “writing SAS” — we are
building data pipelines.ENGINEERING SKILLS We LEARN
We learned how to build structured datasets from scratch using
SAS.
We practiced:
|
Skill |
What
it means in real life |
|
DATA Step |
Creating astronaut master records |
|
SET |
Combining multiple astronaut tables |
|
APPEND |
Adding new astronauts |
|
MERGE |
Linking astronaut data with country stats |
|
TRANSPOSE |
Converting rows to columns for reporting |
These are the same techniques used in:
·
Clinical trials
·
Banking risk systems
·
Aerospace crew management
·
HR analytics
2. DATE AND TIME ANALYTICS (MOST IMPORTANT)
Space agencies depend heavily on time calculations.
We learned how to use:
|
Function |
What
you did |
|
MDY |
Created proper calendar dates |
|
INTNX |
Calculated mission start and end dates |
|
INTCK |
Measured years of service in space |
This is exactly how:
·
NASA tracks astronaut service
·
Pharma companies track drug exposure
·
Banks track account age
We now know how to handle time-based analytics, which is one of the most in-demand SAS skills.
About the Author:
SAS Learning Hub is a data analytics and SAS programming platform focused on clinical, financial, and real-world data analysis. The content is created by professionals with academic training in Pharmaceutics and hands-on experience in Base SAS, PROC SQL, Macros, SDTM, and ADaM, providing practical and industry-relevant SAS learning resources.
Disclaimer:
The datasets and analysis in this article are created for educational and demonstration purposes only. They do not represent astronaut data.
Our Mission:
This blog provides industry-focused SAS programming tutorials and analytics projects covering finance, healthcare, and technology.
This project is suitable for:
SAS Programmer Interviews
SAS Programmer Job Seekers
SAS Analysts
Comments
Post a Comment