336.Can PROC SQL and PROC SORT uncover which space inventions truly transformed global technology and innovation?

Can PROC SQL and PROC SORT uncover which space inventions truly transformed global technology and innovation?

 options nocenter;

1.Creating the Dataset space_inventions

data space_inventions;

    infile datalines dlm='|' missover;

    input Invention_Name :$40. Inventor :$30. Year Country :$20. Usage :$60.

           Success_Level :$15. Date_Assigned :yymmdd10.;

    format Date_Assigned yymmdd10.;

datalines;

Artificial Satellite|Sergei Korolev|1957|USSR|Global Communication & Observation|High|1957-10-04

Space Suit|Nikolai Kamanin|1961|USSR|Astronaut Safety|High|1961-04-12

Apollo Guidance Computer|MIT Instrumentation Lab|1966|USA|Navigation System|High|1966-02-01

Space Shuttle|NASA|1981|USA|Reusable Spacecraft|Medium|1981-04-12

Hubble Telescope|NASA/ESA|1990|USA/EU|Deep-Space Observation|High|1990-04-24

Mars Rover Sojourner|NASA|1997|USA|Planetary Exploration|High|1997-07-04

International Space Station|Multiple Agencies|1998|International|Orbiting Laboratory|High|1998-11-20

Ion Propulsion Engine|NASA|1998|USA|Spacecraft Propulsion|High|1998-10-24

Reusable Rocket (Falcon 9)|SpaceX|2015|USA|Cost-Efficient Launch|High|2015-12-22

Chandrayaan Lander|ISRO|2019|India|Lunar Exploration|Medium|2019-09-07

Solar Sail Spacecraft|JAXA|2010|Japan|Photon Propulsion|Medium|2010-05-21

James Webb Space Telescope|NASA/ESA/CSA|2021|International|Infrared Space Observation|High|2021-12-25

;

run;

proc print data=space_inventions;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_Assigned
1Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHigh1957-10-04
2Space SuitNikolai Kamanin1961USSRAstronaut SafetyHigh1961-04-12
3Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHigh1966-02-01
4Space ShuttleNASA1981USAReusable SpacecraftMedium1981-04-12
5Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHigh1990-04-24
6Mars Rover SojournerNASA1997USAPlanetary ExplorationHigh1997-07-04
7International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHigh1998-11-20
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHigh1998-10-24
9Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHigh2015-12-22
10Chandrayaan LanderISRO2019IndiaLunar ExplorationMedium2019-09-07
11Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionMedium2010-05-21
12James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHigh2021-12-25


2.PROC CONTENTS (Structure Review)

proc contents data=space_inventions;

run;

OUTPUT:

The CONTENTS Procedure

Data Set NameWORK.SPACE_INVENTIONSObservations12
Member TypeDATAVariables7
EngineV9Indexes0
Created12/12/2025 07:30:04Observation Length184
Last Modified12/12/2025 07:30:04Deleted Observations0
Protection CompressedNO
Data Set Type SortedNO
Label   
Data RepresentationSOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64  
Encodingutf-8 Unicode (UTF-8)  
Engine/Host Dependent Information
Data Set Page Size131072
Number of Data Set Pages1
First Data Page1
Max Obs per Page711
Obs in First Data Page12
Number of Data Set Repairs0
Filename/saswork/SAS_work835B0001E69A_odaws01-apse1-2.oda.sas.com/SAS_workE8080001E69A_odaws01-apse1-2.oda.sas.com/space_inventions.sas7bdat
Release Created9.0401M8
Host CreatedLinux
Inode Number201394094
Access Permissionrw-r--r--
Owner Nameu63247146
File Size256KB
File Size (bytes)262144
Alphabetic List of Variables and Attributes
#VariableTypeLenFormat
4CountryChar20 
7Date_AssignedNum8YYMMDD10.
1Invention_NameChar40 
2InventorChar30 
6Success_LevelChar15 
5UsageChar60 
3YearNum8 

3.PROC SQL for Data Exploration

proc sql;

    create table inventions_sql as

    select Invention_Name,Inventor,Year,Country,Usage,Success_Level,Date_Assigned,

           intck('year', Date_Assigned, today()) as Years_Since_Invention,

           intnx('year', Date_Assigned, 10, 'same') as Date_10Years_After format=yymmdd10.

    from space_inventions

    order by Year;

quit;

proc print data=inventions_sql;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_AssignedYears_Since_InventionDate_10Years_After
1Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHigh1957-10-04681967-10-04
2Space SuitNikolai Kamanin1961USSRAstronaut SafetyHigh1961-04-12641971-04-12
3Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHigh1966-02-01591976-02-01
4Space ShuttleNASA1981USAReusable SpacecraftMedium1981-04-12441991-04-12
5Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHigh1990-04-24352000-04-24
6Mars Rover SojournerNASA1997USAPlanetary ExplorationHigh1997-07-04282007-07-04
7International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHigh1998-11-20272008-11-20
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHigh1998-10-24272008-10-24
9Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionMedium2010-05-21152020-05-21
10Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHigh2015-12-22102025-12-22
11Chandrayaan LanderISRO2019IndiaLunar ExplorationMedium2019-09-0762029-09-07
12James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHigh2021-12-2542031-12-25


4.PROC FORMAT for Categorizing Success Level

proc format;

    value $successfmt

        'High' = 'Highly Successful'

        'Medium' = 'Moderately Successful'

        'Low' = 'Less Impactful';

run;

LOG:

NOTE: Format $SUCCESSFMT has been output.

proc print data=space_inventions;

    format Success_Level $successfmt.;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_Assigned
1Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHighly Successful1957-10-04
2Space SuitNikolai Kamanin1961USSRAstronaut SafetyHighly Successful1961-04-12
3Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHighly Successful1966-02-01
4Space ShuttleNASA1981USAReusable SpacecraftModerately Successful1981-04-12
5Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHighly Successful1990-04-24
6Mars Rover SojournerNASA1997USAPlanetary ExplorationHighly Successful1997-07-04
7International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHighly Successful1998-11-20
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHighly Successful1998-10-24
9Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHighly Successful2015-12-22
10Chandrayaan LanderISRO2019IndiaLunar ExplorationModerately Successful2019-09-07
11Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionModerately Successful2010-05-21
12James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHighly Successful2021-12-25


5.Macro for Importance Grouping

%macro importance_group(level);

    %sysfunc(ifc(%upcase(&level)=HIGH,Important,

                       %sysfunc(ifc(%upcase(&level)=MEDIUM,Moderate,Low))))

%mend;


data inventions_with_group;

    set space_inventions;

    length Importance_Group $20;

    Importance_Group = resolve('%importance_group(' || trim(Success_Level) || ')');

run;

proc print data=inventions_with_group;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_AssignedImportance_Group
1Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHigh1957-10-04Important
2Space SuitNikolai Kamanin1961USSRAstronaut SafetyHigh1961-04-12Important
3Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHigh1966-02-01Important
4Space ShuttleNASA1981USAReusable SpacecraftMedium1981-04-12Moderate
5Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHigh1990-04-24Important
6Mars Rover SojournerNASA1997USAPlanetary ExplorationHigh1997-07-04Important
7International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHigh1998-11-20Important
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHigh1998-10-24Important
9Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHigh2015-12-22Important
10Chandrayaan LanderISRO2019IndiaLunar ExplorationMedium2019-09-07Moderate
11Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionMedium2010-05-21Moderate
12James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHigh2021-12-25Important


6.Using PROC MEANS for Year Statistics - I

proc means data=space_inventions mean min max n;

    var Year;

run;

OUTPUT:

The MEANS Procedure

Analysis Variable : Year
MeanMinimumMaximumN
1992.751957.002021.0012

7.Using PROC FREQ for Distribution Analysis

proc freq data=space_inventions;

    tables Country Success_Level;

run;

OUTPUT:

The FREQ Procedure

CountryFrequencyPercentCumulative
Frequency
Cumulative
Percent
India18.3318.33
International216.67325.00
Japan18.33433.33
USA541.67975.00
USA/EU18.331083.33
USSR216.6712100.00
Success_LevelFrequencyPercentCumulative
Frequency
Cumulative
Percent
High975.00975.00
Medium325.0012100.00

8.PROC SORT + PRINT

proc sort data=space_inventions out=inventions_sorted;

    by Country Year;

run;


proc print data=inventions_sorted;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_Assigned
1Chandrayaan LanderISRO2019IndiaLunar ExplorationMedium2019-09-07
2International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHigh1998-11-20
3James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHigh2021-12-25
4Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionMedium2010-05-21
5Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHigh1966-02-01
6Space ShuttleNASA1981USAReusable SpacecraftMedium1981-04-12
7Mars Rover SojournerNASA1997USAPlanetary ExplorationHigh1997-07-04
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHigh1998-10-24
9Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHigh2015-12-22
10Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHigh1990-04-24
11Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHigh1957-10-04
12Space SuitNikolai Kamanin1961USSRAstronaut SafetyHigh1961-04-12


9.Date Format Demonstrations 

data date_examples;

    set space_inventions;


    /* Extract Year, Month, Day from Date_Assigned */

    Year_Extract = year(Date_Assigned);

    Month_Extract = month(Date_Assigned);

    Day_Extract = day(Date_Assigned);


    /* Add 30 Days */

    Date_Plus30 = intnx('day', Date_Assigned, 30);


    /* Compare Years */

    Years_Diff = intck('year', Date_Assigned, today());


    /* Use MDY Function */

    Recreated_Date = mdy(month(Date_Assigned), day(Date_Assigned), Year);


    format Date_Plus30 Recreated_Date yymmdd10.;

run;


proc print data=date_examples;

run;

OUTPUT:

ObsInvention_NameInventorYearCountryUsageSuccess_LevelDate_AssignedYear_ExtractMonth_ExtractDay_ExtractDate_Plus30Years_DiffRecreated_Date
1Artificial SatelliteSergei Korolev1957USSRGlobal Communication & ObservationHigh1957-10-0419571041957-11-03681957-10-04
2Space SuitNikolai Kamanin1961USSRAstronaut SafetyHigh1961-04-1219614121961-05-12641961-04-12
3Apollo Guidance ComputerMIT Instrumentation Lab1966USANavigation SystemHigh1966-02-011966211966-03-03591966-02-01
4Space ShuttleNASA1981USAReusable SpacecraftMedium1981-04-1219814121981-05-12441981-04-12
5Hubble TelescopeNASA/ESA1990USA/EUDeep-Space ObservationHigh1990-04-2419904241990-05-24351990-04-24
6Mars Rover SojournerNASA1997USAPlanetary ExplorationHigh1997-07-041997741997-08-03281997-07-04
7International Space StationMultiple Agencies1998InternationalOrbiting LaboratoryHigh1998-11-20199811201998-12-20271998-11-20
8Ion Propulsion EngineNASA1998USASpacecraft PropulsionHigh1998-10-24199810241998-11-23271998-10-24
9Reusable Rocket (Falcon 9)SpaceX2015USACost-Efficient LaunchHigh2015-12-22201512222016-01-21102015-12-22
10Chandrayaan LanderISRO2019IndiaLunar ExplorationMedium2019-09-072019972019-10-0762019-09-07
11Solar Sail SpacecraftJAXA2010JapanPhoton PropulsionMedium2010-05-2120105212010-06-20152010-05-21
12James Webb Space TelescopeNASA/ESA/CSA2021InternationalInfrared Space ObservationHigh2021-12-25202112252022-01-2442021-12-25


10.Additional PROC Procedures to Demonstrate Complexity PROC UNIVARIATE

proc univariate data=space_inventions;

    var Year;

run;

OUTPUT:

The UNIVARIATE Procedure

Variable: Year

Moments
N12Sum Weights12
Mean1992.75Sum Observations23913
Std Deviation22.361188Variance500.022727
Skewness-0.4032807Kurtosis-1.1165758
Uncorrected SS47658131Corrected SS5500.25
Coeff Variation1.12212711Std Error Mean6.45511895
Basic Statistical Measures
LocationVariability
Mean1992.750Std Deviation22.36119
Median1997.500Variance500.02273
Mode1998.000Range64.00000
  Interquartile Range39.00000
Tests for Location: Mu0=0
TestStatisticp Value
Student's tt308.7085Pr > |t|<.0001
SignM6Pr >= |M|0.0005
Signed RankS39Pr >= |S|0.0005
Quantiles (Definition 5)
LevelQuantile
100% Max2021.0
99%2021.0
95%2021.0
90%2019.0
75% Q32012.5
50% Median1997.5
25% Q11973.5
10%1961.0
5%1957.0
1%1957.0
0% Min1957.0
Extreme Observations
LowestHighest
ValueObsValueObs
1957119988
19612201011
1966320159
19814201910
19905202112

11.Using PROC MEANS for Year Statistics - II

proc means data=space_inventions;

    var Year Usage;

run;

LOG:
69 proc means data=space_inventions;
70 var Year Usage;
ERROR: Variable Usage in list does not match type prescribed
for this list.
71 run;
NOTE: The SAS System stopped processing this step because
of errors.

/* Note: In practice above there is an Invalid in this code Find it,Correct it and Use it /*


YESTERDAY INVALID CODE ANSWER

14. Average of  Steps_Per_Day

proc avg data=work.fitness_final;

  var Steps_Per_Day;

run;

proc means data=work.fitness_final mean;

    var Steps_Per_Day;

run;

OUTPUT:

Obs_TYPE__FREQ_Avg_Steps
10127666.67

PROC AVG does NOT exist in SAS.
To compute an average (mean), SAS uses PROC MEANS or PROC SUMMARY
Here we used PROC MEANS.

/* Note: In practice above there is an Invalid in this code Find it,Correct it and Use it /*




To Visit My Previous Software Company Analysis Dataset:Click Here
To Visit My Previous Vote Program Dataset:Click Here
To Visit My Previous Audi Cars Performance Analysis Dataset:Click Here
To Visit My Previous Global Clothing Trends Dataset:Click Here  



Follow Us On : 


 


--- FOLLOW OUR BLOG FOR MORE INFORMATION.

--->PLEASE DO COMMENTS AND SHARE OUR BLOG.

Comments

Popular posts from this blog

397.If a satellite has excellent signal strength but very high latency, can it still deliver good quality communication? Why or why not?A Sas Study

401.How Efficient Are Global Data Centers? A Complete SAS Analytics Study

383.Which Pharma Distributors Are High-Risk? Can SAS Detect Delays, Temperature Violations, and Fraud?