425.Can Advanced SAS Programming Detect Fraud And Correct Data Errors In Global Space Ground Station Operations?
Exploring Data Accuracy And Fraud Detection In Global Ground Station Operations Using SAS
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HERE IN THIS PROJECT WE USED THESE SAS STATEMENTS —DATA STEP | LENGTH | INPUT | DATALINES | FORMAT | SET | IF-THEN- KEEP | DROP | MERGE | PROC SORT | PROC PRINT | PROC APPEND | PROC TRANSPOSE | PROC DATASETS | MACRO
Introduction
Space
ground stations are critical infrastructure used by space agencies and
satellite operators to communicate with orbiting satellites. These stations
track satellite signals, transmit telemetry data, and support navigation and
scientific missions.
Ground
station networks exist across the world and are operated by agencies such as:
·
NASA
·
ESA
·
ISRO
·
CNSA
·
JAXA
Because these facilities manage expensive satellite missions, data integrity is extremely important.
Incorrect tracking logs, corrupted signal data, or manipulated operational
statistics can lead to mission failures or financial losses.
For example:
·
A ground station may report incorrect tracking hours
·
Satellites supported may be incorrectly recorded
·
Signal loss events may be fraudulently modified
·
Operating costs might be inflated or under-reported
·
Reliability percentages might exceed 100% or fall below 0%
In this project, we simulate a Space
Ground Station Operations Dataset and deliberately introduce intentional errors to demonstrate how
SAS can detect and correct them.
The project demonstrates practical SAS
programming concepts including:
·
Data step processing
·
Numeric functions
·
Character functions
·
Date handling
·
Dataset merging
·
Dataset appending
·
Transposing data
·
Macro-based fraud detection
·
Data validation
This type of workflow
is extremely valuable in real-world
aerospace data analytics and satellite network management systems.
Table Of Contents
1.
Business Context
2.
Dataset Design
3.
Intentional Errors Introduced
4.
Code 1 – Create Raw Dataset With Errors
5.
Code 2 – PROC CONTENTS Metadata Check
6.
Code 3 – Standardizing Station Names
7.
Code 4 – Numeric Error Detection
8.
Code 5 – Date Standardization Using MDY
9.
Code 6 – Usage Duration Calculation Using INTCK
10. Code
7 – Forecast Maintenance Using INTNX
11. Code
8 – PROC
SORT & Dataset MERGE
Operation
12. Code
9 – Dataset APPEND Operation
13. Code
10 – Dataset TRANSPOSE Operation
14. Code
11 – Utilization Classification
15. Code
12 – Fraud Detection Macro
16. Code
13 – Final Data Cleaning Logic
17. Code
14 – PROC DATASETS Delete Temporary Tables
18. Final
Corrected Dataset Code
19. Project
Insights
20. Summary
21. Conclusion
Business Context
Satellite ground station operators track
several operational parameters daily.
Typical metrics include:
|
Metric |
Purpose |
|
Tracking Hours |
Measures communication time with satellites |
|
Satellites Supported |
Number of satellites served |
|
Signal Loss Events |
Measures communication disruptions |
|
Operating Cost |
Daily operational expenditure |
|
Reliability Index |
System stability percentage |
|
Utilization |
Network capacity usage |
If these metrics contain errors, it may cause:
·
Poor satellite scheduling
·
Resource wastage
·
Incorrect billing
·
Security vulnerabilities
Therefore, automated validation is required.
Dataset Variables
Our dataset includes the following variables:
|
Variable |
Description |
|
Station_Name |
Name of the ground station |
|
Country |
Country where station is located |
|
Tracking_Hours |
Daily tracking hours |
|
Satellites_Supported |
Number of satellites handled |
|
Signal_Loss_Events |
Number of signal disruptions |
|
Operating_Cost |
Daily operating cost |
|
Reliability_Index |
Reliability percentage |
|
Fees |
Service revenue |
|
Utilization |
Capacity usage classification |
|
Operation_Date |
Date of operation |
Intentional Errors Introduced
To simulate real-world data corruption, the
dataset contains:
1.
Negative tracking
hours
2.
Reliability >
100%
3.
Negative
operating costs
4.
Lowercase /
uppercase inconsistencies
5.
Extra spaces in
station names
6.
Missing country
values
7.
Wrong date
formats
8.
Invalid satellite
counts
9.
Duplicated
station names
These errors will be detected and corrected using SAS.
Code 1 – Creating Raw Dataset With Intentional Errors
data ground_station_raw;
infile datalines dsd truncover;
input Station_Name :$30. Country :$20. Tracking_Hours Satellites_Supported
Signal_Loss_Events Operating_Cost Reliability_Index Fees
Operation_Date :$12.;
datalines;
sriharikota,India,12,8,2,15000,95,20000,03-01-2025
Goldstone,USA,14,10,1,20000,101,30000,03-02-2025
malindi,Kenya,-5,6,3,10000,89,15000,03-03-2025
Kourou,France,16,9,2,-12000,92,21000,03-04-2025
svalbard,Norway,18,11,0,17000,98,25000,03-05-2025
Alaska,USA,13,7,4,14000,87,19000,03-06-2025
beijing,China,15,twelve,1,21000,93,31000,03-07-2025
Perth,Australia,20,14,2,22000,97,33000,03-08-2025
Madrid,Spain,10,5,three,12000,85,16000,03-09-2025
Santiago,Chile,17,10,2,18000,94,24000,03-10-2025
Pretoria,SouthAfrica,11,6,4,13000,88,17000,03-11-2025
Bangalore,India,19,13,1,21000,96,32000,03-12-2025
Svalbard,Norway,21,15,0,25000,105,35000,03-13-2025
Dubai,UAE,8,3,6,9000,80,12000,wrong-date
Tokyo,Japan,22,16,1,26000,99,36000,03-15-2025
;
run;
proc print data=ground_station_raw;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date |
|---|---|---|---|---|---|---|---|---|---|
| 1 | sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 |
| 2 | Goldstone | USA | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 |
| 3 | malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 |
| 5 | svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 |
| 6 | Alaska | USA | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 |
| 7 | beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 |
| 11 | Pretoria | SouthAfrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 |
| 14 | Dubai | UAE | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 |
Explanation
This DATA step creates the raw dataset.
However, several errors exist.
Examples:
·
Tracking hours = -5
·
Reliability index = 101 and 105
·
Operating cost = -12000
·
Station names inconsistent
Why This Code Is Used
·
To simulate real operational datasets
·
To intentionally insert data quality problems
·
To test SAS data validation techniques
Code 2 – Inspect Dataset Structure
proc contents data=ground_station_raw;
run;
OUTPUT:
The CONTENTS Procedure
| Data Set Name | WORK.GROUND_STATION_RAW | Observations | 15 |
|---|---|---|---|
| Member Type | DATA | Variables | 9 |
| Engine | V9 | Indexes | 0 |
| Created | 03/11/2026 10:37:43 | Observation Length | 112 |
| Last Modified | 03/11/2026 10:37:43 | Deleted Observations | 0 |
| Protection | Compressed | NO | |
| Data Set Type | Sorted | NO | |
| Label | |||
| Data Representation | SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64 | ||
| Encoding | utf-8 Unicode (UTF-8) |
| Engine/Host Dependent Information | |
|---|---|
| Data Set Page Size | 131072 |
| Number of Data Set Pages | 1 |
| First Data Page | 1 |
| Max Obs per Page | 1168 |
| Obs in First Data Page | 15 |
| Number of Data Set Repairs | 0 |
| Filename | /saswork/SAS_workD45F00006B56_odaws01-apse1-2.oda.sas.com/SAS_workFE6000006B56_odaws01-apse1-2.oda.sas.com/ground_station_raw.sas7bdat |
| Release Created | 9.0401M8 |
| Host Created | Linux |
| Inode Number | 201353440 |
| Access Permission | rw-r--r-- |
| Owner Name | u63247146 |
| File Size | 256KB |
| File Size (bytes) | 262144 |
| Alphabetic List of Variables and Attributes | |||
|---|---|---|---|
| # | Variable | Type | Len |
| 2 | Country | Char | 20 |
| 8 | Fees | Num | 8 |
| 6 | Operating_Cost | Num | 8 |
| 9 | Operation_Date | Char | 12 |
| 7 | Reliability_Index | Num | 8 |
| 4 | Satellites_Supported | Num | 8 |
| 5 | Signal_Loss_Events | Num | 8 |
| 1 | Station_Name | Char | 30 |
| 3 | Tracking_Hours | Num | 8 |
Explanation
PROC CONTENTS displays dataset metadata
including:
· Variable
names
·
Variable types
·
Lengths
·
Formats
Why It Is Important
Before cleaning data, analysts must verify:
· Variable
types
·
Variable formats
·
Metadata consistency
Code 3 – Character Data Cleaning
data station_clean_names;
set ground_station_raw;
Station_Name=propcase(strip(Station_Name));
Country=propcase(strip(Country));
Station_Upper=upcase(Station_Name);
Station_Lower=lowcase(Station_Name);
Station_Clean=catx('_',Station_Name,Country);
run;
proc print data=station_clean_names;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India |
| 2 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa |
| 3 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France |
| 5 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway |
| 6 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa |
| 7 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile |
| 11 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway |
| 14 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan |
Character Functions Used
|
Function |
Purpose |
|
STRIP |
Removes leading/trailing spaces |
|
TRIM |
Removes trailing spaces |
|
CAT |
Concatenate values |
|
CATX |
Concatenate with delimiter |
|
PROPCASE |
Convert to Proper Case |
|
UPCASE |
Uppercase |
|
LOWCASE |
Lowercase |
Explanation
This step standardizes textual data.
Example transformation:
"
sriharikota " → "Sriharikota"
Code 4 – Numeric Error Detection
data numeric_validation;
set station_clean_names;
length Error_Flag $20.;
if Tracking_Hours < 0 then Error_Flag='Negative Hours';
if Reliability_Index >100 then Error_Flag='Invalid Reliability';
if Operating_Cost <0 then Error_Flag='Negative Cost';
run;
proc print data=numeric_validation;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | |
| 2 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability |
| 3 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost |
| 5 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | |
| 6 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | |
| 7 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | |
| 11 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability |
| 14 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan |
Explanation
This code flags suspicious values.
Example errors detected:
·
Negative hours
·
Reliability above 100
·
Negative cost
Code 5 – Converting Date Using MDY
data date_format_fix;
set numeric_validation;
month=input(substr(Operation_Date,1,2),8.);
day=input(substr(Operation_Date,4,2),8.);
year=input(substr(Operation_Date,7,4),8.);
Correct_Date=mdy(month,day,year);
format Correct_Date date9.;
run;
proc print data=date_format_fix;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | |
| 2 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 |
| 3 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 |
| 5 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | |
| 6 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | |
| 7 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | |
| 11 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 |
| 14 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 |
Why MDY Is Used
MDY constructs a SAS date.
MDY(month,day,year)
Example:
03-01-2025
→ 01MAR2025
Code 6 – Calculating Tracking Duration
data duration_calc;
set date_format_fix;
Days_Since=intck('day',Correct_Date,today());
run;
proc print data=duration_calc;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | |
| 2 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 |
| 3 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 |
| 5 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | |
| 6 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | |
| 7 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | |
| 11 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 |
| 14 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 |
INTCK Function
INTCK calculates intervals between dates.
Example:
INTCK('day',date1,date2)
Code 7 – Predicting Next Maintenance Date
data maintenance_forecast;
set duration_calc;
Next_Maintenance=intnx('month',Correct_Date,6,'same');
format Next_Maintenance date9.;
run;
proc print data=maintenance_forecast;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 2 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 3 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 4 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 5 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 6 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 7 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 8 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 9 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 10 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 11 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 12 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 13 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 14 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
INTNX Function
INTNX calculates future or past dates.
Example:
INTNX('month',date,6)
This
predicts maintenance after 6 months.
Code 8 – PROC SORT & Dataset MERGE
proc sort data=maintenance_forecast;by Station_Name;run;
proc print data=maintenance_forecast;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
proc sort data=numeric_validation;by Station_Name;run;
proc print data=numeric_validation;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | |
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan |
data station_merge;
merge maintenance_forecast
numeric_validation;
by Station_Name;
run;
proc print data=station_merge;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
Why SORT Is Used
Sort is used to order the observations in
ascending or descending.
Why MERGE Is Used
MERGE combines datasets using a common key.
Code 9 – Dataset APPEND
proc append base=station_merge
data=maintenance_forecast;
run;
proc print data=station_merge;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 | |
| 16 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 17 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 18 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 19 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 20 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 21 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 22 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 23 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 24 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 25 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 26 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 27 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 28 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 29 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 30 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
Explanation
APPEND adds observations to an existing dataset.
Code 10 – Dataset TRANSPOSE
proc transpose data=station_merge out=station_transpose;
by Station_Name NotSorted;
var Tracking_Hours Satellites_Supported Operating_Cost Fees;
run;
proc print data=station_transpose;
run;
OUTPUT:
| Obs | Station_Name | _NAME_ | COL1 | COL2 |
|---|---|---|---|---|
| 1 | Alaska | Tracking_Hours | 13 | . |
| 2 | Alaska | Satellites_Supported | 7 | . |
| 3 | Alaska | Operating_Cost | 14000 | . |
| 4 | Alaska | Fees | 19000 | . |
| 5 | Bangalore | Tracking_Hours | 19 | . |
| 6 | Bangalore | Satellites_Supported | 13 | . |
| 7 | Bangalore | Operating_Cost | 21000 | . |
| 8 | Bangalore | Fees | 32000 | . |
| 9 | Beijing | Tracking_Hours | 15 | . |
| 10 | Beijing | Satellites_Supported | . | . |
| 11 | Beijing | Operating_Cost | 21000 | . |
| 12 | Beijing | Fees | 31000 | . |
| 13 | Dubai | Tracking_Hours | 8 | . |
| 14 | Dubai | Satellites_Supported | 3 | . |
| 15 | Dubai | Operating_Cost | 9000 | . |
| 16 | Dubai | Fees | 12000 | . |
| 17 | Goldstone | Tracking_Hours | 14 | . |
| 18 | Goldstone | Satellites_Supported | 10 | . |
| 19 | Goldstone | Operating_Cost | 20000 | . |
| 20 | Goldstone | Fees | 30000 | . |
| 21 | Kourou | Tracking_Hours | 16 | . |
| 22 | Kourou | Satellites_Supported | 9 | . |
| 23 | Kourou | Operating_Cost | -12000 | . |
| 24 | Kourou | Fees | 21000 | . |
| 25 | Madrid | Tracking_Hours | 10 | . |
| 26 | Madrid | Satellites_Supported | 5 | . |
| 27 | Madrid | Operating_Cost | 12000 | . |
| 28 | Madrid | Fees | 16000 | . |
| 29 | Malindi | Tracking_Hours | -5 | . |
| 30 | Malindi | Satellites_Supported | 6 | . |
| 31 | Malindi | Operating_Cost | 10000 | . |
| 32 | Malindi | Fees | 15000 | . |
| 33 | Perth | Tracking_Hours | 20 | . |
| 34 | Perth | Satellites_Supported | 14 | . |
| 35 | Perth | Operating_Cost | 22000 | . |
| 36 | Perth | Fees | 33000 | . |
| 37 | Pretoria | Tracking_Hours | 11 | . |
| 38 | Pretoria | Satellites_Supported | 6 | . |
| 39 | Pretoria | Operating_Cost | 13000 | . |
| 40 | Pretoria | Fees | 17000 | . |
| 41 | Santiago | Tracking_Hours | 17 | . |
| 42 | Santiago | Satellites_Supported | 10 | . |
| 43 | Santiago | Operating_Cost | 18000 | . |
| 44 | Santiago | Fees | 24000 | . |
| 45 | Sriharikota | Tracking_Hours | 12 | . |
| 46 | Sriharikota | Satellites_Supported | 8 | . |
| 47 | Sriharikota | Operating_Cost | 15000 | . |
| 48 | Sriharikota | Fees | 20000 | . |
| 49 | Svalbard | Tracking_Hours | 18 | 21 |
| 50 | Svalbard | Satellites_Supported | 11 | 15 |
| 51 | Svalbard | Operating_Cost | 17000 | 25000 |
| 52 | Svalbard | Fees | 25000 | 35000 |
| 53 | Tokyo | Tracking_Hours | 22 | . |
| 54 | Tokyo | Satellites_Supported | 16 | . |
| 55 | Tokyo | Operating_Cost | 26000 | . |
| 56 | Tokyo | Fees | 36000 | . |
| 57 | Alaska | Tracking_Hours | 13 | . |
| 58 | Alaska | Satellites_Supported | 7 | . |
| 59 | Alaska | Operating_Cost | 14000 | . |
| 60 | Alaska | Fees | 19000 | . |
| 61 | Bangalore | Tracking_Hours | 19 | . |
| 62 | Bangalore | Satellites_Supported | 13 | . |
| 63 | Bangalore | Operating_Cost | 21000 | . |
| 64 | Bangalore | Fees | 32000 | . |
| 65 | Beijing | Tracking_Hours | 15 | . |
| 66 | Beijing | Satellites_Supported | . | . |
| 67 | Beijing | Operating_Cost | 21000 | . |
| 68 | Beijing | Fees | 31000 | . |
| 69 | Dubai | Tracking_Hours | 8 | . |
| 70 | Dubai | Satellites_Supported | 3 | . |
| 71 | Dubai | Operating_Cost | 9000 | . |
| 72 | Dubai | Fees | 12000 | . |
| 73 | Goldstone | Tracking_Hours | 14 | . |
| 74 | Goldstone | Satellites_Supported | 10 | . |
| 75 | Goldstone | Operating_Cost | 20000 | . |
| 76 | Goldstone | Fees | 30000 | . |
| 77 | Kourou | Tracking_Hours | 16 | . |
| 78 | Kourou | Satellites_Supported | 9 | . |
| 79 | Kourou | Operating_Cost | -12000 | . |
| 80 | Kourou | Fees | 21000 | . |
| 81 | Madrid | Tracking_Hours | 10 | . |
| 82 | Madrid | Satellites_Supported | 5 | . |
| 83 | Madrid | Operating_Cost | 12000 | . |
| 84 | Madrid | Fees | 16000 | . |
| 85 | Malindi | Tracking_Hours | -5 | . |
| 86 | Malindi | Satellites_Supported | 6 | . |
| 87 | Malindi | Operating_Cost | 10000 | . |
| 88 | Malindi | Fees | 15000 | . |
| 89 | Perth | Tracking_Hours | 20 | . |
| 90 | Perth | Satellites_Supported | 14 | . |
| 91 | Perth | Operating_Cost | 22000 | . |
| 92 | Perth | Fees | 33000 | . |
| 93 | Pretoria | Tracking_Hours | 11 | . |
| 94 | Pretoria | Satellites_Supported | 6 | . |
| 95 | Pretoria | Operating_Cost | 13000 | . |
| 96 | Pretoria | Fees | 17000 | . |
| 97 | Santiago | Tracking_Hours | 17 | . |
| 98 | Santiago | Satellites_Supported | 10 | . |
| 99 | Santiago | Operating_Cost | 18000 | . |
| 100 | Santiago | Fees | 24000 | . |
| 101 | Sriharikota | Tracking_Hours | 12 | . |
| 102 | Sriharikota | Satellites_Supported | 8 | . |
| 103 | Sriharikota | Operating_Cost | 15000 | . |
| 104 | Sriharikota | Fees | 20000 | . |
| 105 | Svalbard | Tracking_Hours | 18 | 21 |
| 106 | Svalbard | Satellites_Supported | 11 | 15 |
| 107 | Svalbard | Operating_Cost | 17000 | 25000 |
| 108 | Svalbard | Fees | 25000 | 35000 |
| 109 | Tokyo | Tracking_Hours | 22 | . |
| 110 | Tokyo | Satellites_Supported | 16 | . |
| 111 | Tokyo | Operating_Cost | 26000 | . |
| 112 | Tokyo | Fees | 36000 | . |
Why TRANSPOSE Is Used
TRANSPOSE converts rows into columns.
Used for:
·
Reporting
·
Analytical transformations
Code 11 – Utilization Classification
data utilization_class;
set station_merge;
length Utilization $8.;
if Tracking_Hours >=20 then Utilization='High';
else if Tracking_Hours >=12 then Utilization='Medium';
else Utilization='Low';
run;
proc print data=utilization_class;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance | Utilization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | Medium | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | Medium | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | Medium | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | Low | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 | Medium |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 | Medium |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | Low | |
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 | Low |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | High | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | Low | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | Medium | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | Medium | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | Medium | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 | High |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 | High | |
| 16 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | Medium | |
| 17 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | Medium | |
| 18 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | Medium | |
| 19 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | Low | |
| 20 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 | Medium |
| 21 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 | Medium |
| 22 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | Low | |
| 23 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 | Low |
| 24 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | High | |
| 25 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | Low | |
| 26 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | Medium | |
| 27 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | Medium | |
| 28 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | Medium | |
| 29 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 | High |
| 30 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 | High |
Explanation
This macro automatically checks:
·
Invalid reliability
·
Negative hours
·
Negative cost
Macros make SAS reusable and
scalable.
Code 12 – Macro For Fraud Detection
%macro fraud_detection(ds);
data fraud_check;
set &ds;
if Reliability_Index >100 then Fraud='Yes';
if Tracking_Hours <0 then Fraud='Yes';
if Operating_Cost <0 then Fraud='Yes';
run;
proc print data=fraud_check;
run;
%mend;
%fraud_detection(station_merge);
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance | Fraud |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | ||
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | ||
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | ||
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | ||
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 | Yes |
| 6 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 | Yes |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | ||
| 8 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 | Yes |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | ||
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | ||
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | ||
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | ||
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | ||
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 | Yes |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 | ||
| 16 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | ||
| 17 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | ||
| 18 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | ||
| 19 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | ||
| 20 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 101 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 | Yes |
| 21 | Kourou | France | 16 | 9 | 2 | -12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 | Yes |
| 22 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | ||
| 23 | Malindi | Kenya | -5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 | Yes |
| 24 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | ||
| 25 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | ||
| 26 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | ||
| 27 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | ||
| 28 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | ||
| 29 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 105 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 | Yes |
| 30 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
Code 13 – Correcting Errors
data station_corrected;
set station_merge;
if Tracking_Hours <0 then Tracking_Hours=abs(Tracking_Hours);
if Reliability_Index>100 then Reliability_Index=100;
if Operating_Cost <0 then Operating_Cost=abs(Operating_Cost);
run;
proc print data=station_corrected;
run;
OUTPUT:
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 100 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 6 | Kourou | France | 16 | 9 | 2 | 12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 8 | Malindi | Kenya | 5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 100 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 15 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 | |
| 16 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 17 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 18 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 19 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 20 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 100 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 21 | Kourou | France | 16 | 9 | 2 | 12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 22 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 23 | Malindi | Kenya | 5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 24 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 25 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 26 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 27 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 28 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 29 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 100 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 30 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
Code 14 – Delete Temporary Datasets
proc datasets library=work;
delete numeric_validation station_transpose duration_calc;
quit;
LOG:
Final Corrected Dataset Code
proc sort data=station_corrected nodup;by Station_Name;run;
proc print data=station_corrected;
title "Final Cleaned Space Ground Station Dataset";
run;
| Obs | Station_Name | Country | Tracking_Hours | Satellites_Supported | Signal_Loss_Events | Operating_Cost | Reliability_Index | Fees | Operation_Date | Station_Upper | Station_Lower | Station_Clean | Error_Flag | month | day | year | Correct_Date | Days_Since | Next_Maintenance |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Alaska | Usa | 13 | 7 | 4 | 14000 | 87 | 19000 | 03-06-2025 | ALASKA | alaska | Alaska_Usa | 3 | 6 | 2025 | 06MAR2025 | 370 | 06SEP2025 | |
| 2 | Bangalore | India | 19 | 13 | 1 | 21000 | 96 | 32000 | 03-12-2025 | BANGALORE | bangalore | Bangalore_India | 3 | 12 | 2025 | 12MAR2025 | 364 | 12SEP2025 | |
| 3 | Beijing | China | 15 | . | 1 | 21000 | 93 | 31000 | 03-07-2025 | BEIJING | beijing | Beijing_China | 3 | 7 | 2025 | 07MAR2025 | 369 | 07SEP2025 | |
| 4 | Dubai | Uae | 8 | 3 | 6 | 9000 | 80 | 12000 | wrong-date | DUBAI | dubai | Dubai_Uae | . | . | . | . | . | . | |
| 5 | Goldstone | Usa | 14 | 10 | 1 | 20000 | 100 | 30000 | 03-02-2025 | GOLDSTONE | goldstone | Goldstone_Usa | Invalid Reliability | 3 | 2 | 2025 | 02MAR2025 | 374 | 02SEP2025 |
| 6 | Kourou | France | 16 | 9 | 2 | 12000 | 92 | 21000 | 03-04-2025 | KOUROU | kourou | Kourou_France | Negative Cost | 3 | 4 | 2025 | 04MAR2025 | 372 | 04SEP2025 |
| 7 | Madrid | Spain | 10 | 5 | . | 12000 | 85 | 16000 | 03-09-2025 | MADRID | madrid | Madrid_Spain | 3 | 9 | 2025 | 09MAR2025 | 367 | 09SEP2025 | |
| 8 | Malindi | Kenya | 5 | 6 | 3 | 10000 | 89 | 15000 | 03-03-2025 | MALINDI | malindi | Malindi_Kenya | Negative Hours | 3 | 3 | 2025 | 03MAR2025 | 373 | 03SEP2025 |
| 9 | Perth | Australia | 20 | 14 | 2 | 22000 | 97 | 33000 | 03-08-2025 | PERTH | perth | Perth_Australia | 3 | 8 | 2025 | 08MAR2025 | 368 | 08SEP2025 | |
| 10 | Pretoria | Southafrica | 11 | 6 | 4 | 13000 | 88 | 17000 | 03-11-2025 | PRETORIA | pretoria | Pretoria_Southafrica | 3 | 11 | 2025 | 11MAR2025 | 365 | 11SEP2025 | |
| 11 | Santiago | Chile | 17 | 10 | 2 | 18000 | 94 | 24000 | 03-10-2025 | SANTIAGO | santiago | Santiago_Chile | 3 | 10 | 2025 | 10MAR2025 | 366 | 10SEP2025 | |
| 12 | Sriharikota | India | 12 | 8 | 2 | 15000 | 95 | 20000 | 03-01-2025 | SRIHARIKOTA | sriharikota | Sriharikota_India | 3 | 1 | 2025 | 01MAR2025 | 375 | 01SEP2025 | |
| 13 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 14 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 100 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 15 | Svalbard | Norway | 18 | 11 | 0 | 17000 | 98 | 25000 | 03-05-2025 | SVALBARD | svalbard | Svalbard_Norway | 3 | 5 | 2025 | 05MAR2025 | 371 | 05SEP2025 | |
| 16 | Svalbard | Norway | 21 | 15 | 0 | 25000 | 100 | 35000 | 03-13-2025 | SVALBARD | svalbard | Svalbard_Norway | Invalid Reliability | 3 | 13 | 2025 | 13MAR2025 | 363 | 13SEP2025 |
| 17 | Tokyo | Japan | 22 | 16 | 1 | 26000 | 99 | 36000 | 03-15-2025 | TOKYO | tokyo | Tokyo_Japan | 3 | 15 | 2025 | 15MAR2025 | 361 | 15SEP2025 |
· SAS can
identify operational anomalies in aerospace datasets
·
Character functions help standardize
inconsistent text
·
Numeric validations detect impossible
values
·
Date functions support mission
scheduling
·
Macros automate fraud detection logic
·
MERGE combines operational logs
·
APPEND extends datasets dynamically
·
TRANSPOSE helps generate analytical
reports
·
Utilization classification supports
capacity planning
·
PROC DATASETS improves workspace
efficiency
Advanced SAS programming can play a significant role in detecting fraud and
correcting data errors in global space ground station operations. Ground
stations generate large volumes of operational data such as tracking hours,
number of satellites supported, signal loss events, operating costs,
reliability percentages, and service fees. When this data contains mistakes,
missing values, or manipulated records, it can affect satellite communication
efficiency and financial reporting. Using SAS, programmers can build validation
rules to identify unusual patterns such as negative tracking hours, reliability
values greater than 100 percent, or incorrect cost entries. SAS functions,
procedures, and macros allow analysts to clean text fields, standardize
formats, validate dates, and flag suspicious observations automatically. By
applying techniques like data merging, transposing, and automated fraud
detection logic, SAS helps transform raw, error-prone data into reliable
operational datasets. As a result, organizations can improve decision-making,
maintain accurate records, and ensure trustworthy monitoring of global ground
station performance.
Conclusion
Space ground station networks generate large
volumes of operational data every day. Because satellite communication is
mission-critical, even small errors in tracking logs or reliability statistics
can have serious consequences.
In this project we demonstrated how Advanced SAS Programming can:
· Detect data
anomalies
·
Identify fraudulent modifications
·
Correct corrupted values
·
Standardize inconsistent records
·
Automate validation processes
Using a combination of:
·
DATA steps
·
Numeric functions
·
Character functions
·
Date handling functions
·
Macros
·
Dataset management procedures
SAS provides a powerful framework for maintaining data integrity in complex operational environments
such as satellite ground station networks.
The same techniques can be applied in other
domains such as:
·
Aviation analytics
·
Defense communication networks
·
Telecommunications monitoring
·
Financial fraud detection
Thus, SAS programming remains a valuable
tool for ensuring high-quality,
reliable data in mission-critical systems.
SAS INTERVIEW QUESTIONS
1.What is the difference between HAVING and WHERE in SQL?
Answer:
WHERE filters rows before aggregation,
while HAVING filters after aggregation.
2.What is a Cartesian join?
Answer:
A Cartesian join occurs when every row of
one table joins with every row of another table.
3.What is DISTINCT used for?
Answer:
DISTINCT removes duplicate rows from
query results.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
About the Author:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
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 GLOBAL SPACE data.
Our Mission:
This blog provides industry-focused SAS programming tutorials and analytics projects covering finance, healthcare, and technology.
This project is suitable for:
· Students learning SAS
· Data analysts building portfolios
· Professionals preparing for SAS interviews
· Bloggers writing about analytics
· Clinical SAS Programmer
· Research Data Analyst
· Regulatory Data Validator
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Comments
Post a Comment