416.Can We Design, Debug, Detect Fraud, and Build an ADaM-Ready Autonomous Drone Flight Analytics System Using Advanced SAS Programming Techniques?

Autonomous Drone Flight Analytics System with Fraud Detection and ADaM Integration

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

HERE IN THIS PROJECT WE USED THESE SAS STATEMENTS —DATA | SET | MERGE | INPUT | DATALINES | IF | DO | END | BY | OUTPUT | PROC SORT | PROC SQL | PROC APPEND | PROC TRANSPOSE | PROC MEANS | PROC FREQ | PROC SUMMARY | PROC DATASETS | RUN | QUIT | %MACRO | %MEND

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Introduction

In real-world analytics environments, building a dataset is only the beginning. A production-level system must support:

·       Data ingestion from operational sources

·       Data validation and cleaning

·       Error debugging

·       Business rule enforcement

·       Fraud detection logic

·       Date derivations and time intelligence

·       Data reshaping and transformation

·       Dataset merging and lifecycle management

·       Analysis-ready dataset preparation

·       Reporting and traceability

This project combines two major domains:

1.     Operational Drone Analytics Engineering

2.     ADaM (Analysis Data Model) Structured Analysis Framework

A complete autonomous drone monitoring system where raw operational data is transformed into a fraud-aware, analysis-ready structure similar to how ADaM datasets are built in clinical research.

Table of Contents

1.     Project Overview

2.     Business Context

3.     Operational Data Engineering Layer

4.     Intentional Error Simulation

5.  Transition to ADaM Principles

6.  ADSL_DRONE (Subject-Level Design)

7.  ADFLIGHT (Parameter-Level Design)

8.  Traceability & Analysis Flags

9.  Enterprise-Level Validation Strategy

10.  25 Key Project Insights

11.  Business Interpretation

12.  Conclusion

Project Overview

This project builds an autonomous drone flight analytics system that combines data cleaning, validation, fraud detection, and ADaM-ready structuring. Raw operational drone data is checked for errors such as invalid percentages, abnormal battery usage, and impossible flight durations. Business rules and fraud logic are applied to flag suspicious records. Finally, the cleaned data is transformed into structured, analysis-ready datasets for reporting and decision-making.

Business Context

Autonomous drones are deployed in:

·       Surveillance missions

·       Medical supply delivery

·       Agricultural spraying

·       Defense operations

·       Logistics transportation

Each drone performs multiple missions across different regions, under different operators, with varying payloads and flight durations.

From a business risk perspective, management wants to detect:

·       Battery usage manipulation

·       Artificially inflated success rates

·       Unrealistic 100% performance records

·       Impossible flight durations

·       Suppressed navigation errors

·       Suspicious zero-duration flights

·       Data entry manipulation

The operational team collects raw data containing:

·       Drone_ID

·       Mission_Type

·       Flight_Time

·       Battery_Usage

·       Navigation_Errors

·       Payload_Weight

·       Success_Rate (%)

·       Launch_Date

·       Landing_Date

·       Region

·       Operator_Name

However, raw data is rarely clean. It often contains:

·       Out-of-range percentages

·       Negative counts

·       Date inconsistencies

·       Formatting mismatches

·       Duplicate records

·       Suspicious operational patterns

This is where engineering discipline meets analytical governance.

Operational Data Engineering Layer

The first layer of the system focuses on:

 Data Ingestion

Collecting drone flight logs from operational systems.

Data Cleaning

Standardizing case formats, trimming spaces, correcting invalid values.

Error Debugging

Detecting:

·       Battery usage > 100%

·       Success rate > 100%

·       Negative navigation errors

·       Landing date earlier than launch date

Business Rule Validation

·       Percentages are between 0 and 100

·       Flight time is positive

·       Dates follow chronological order

·       Payload weight is within engineering tolerance

Intentional Error Simulation

To build a robust system, we intentionally simulate errors such as:

·       Battery usage recorded as 110%

·       Success rate recorded as 105%

·       Negative navigation error count

·       Same-day launch and landing for long missions

·       Perfect 100% performance with zero errors

·       Unrealistically high flight time with minimal battery usage

1. Create Raw Dataset (With Intentional Errors)

data drone_raw;

input Drone_ID $ Mission_Type:$18. Flight_Time Battery_Usage Navigation_Errors 

      Payload_Weight Success_Rate Launch_Month Launch_Day Launch_Year 

      Landing_Month Landing_Day Landing_Year Region $ Operator_Name $;

Launch_Date = mdy(Launch_Month,Launch_Day,Launch_Year);

Landing_Date = mdy(Landing_Month,Landing_Day,Landing_Year);

format Launch_Date Landing_Date date9.;

datalines;

D001 surveillance 120 80 2 5 98 1 15 2025 1 15 2025 south ramesh

D002 delivery 200 110 0 8 105 2 10 2025 2 10 2025 north suresh

D003 agriculture 90 60 5 10 85 3 5 2025 3 6 2025 east kumar

D004 defense 300 95 -1 12 99 4 20 2025 4 20 2025 west rajesh

D005 surveillance 150 75 3 6 101 5 11 2025 5 11 2025 south anil

D006 delivery 220 85 1 7 96 6 1 2025 6 1 2025 north pradeep

D007 agriculture 130 55 4 9 88 7 19 2025 7 20 2025 east sandeep

D008 defense 400 120 0 15 100 8 22 2025 8 22 2025 west manoj

D009 delivery 50 20 10 3 60 9 10 2025 9 10 2025 north ajay

D010 surveillance 170 70 2 5 97 10 15 2025 10 15 2025 south mahesh

D011 agriculture 95 65 6 8 84 11 12 2025 11 13 2025 east naresh

D012 defense 280 100 0 14 102 12 25 2025 12 25 2025 west rakesh

D013 delivery 180 90 3 7 93 1 5 2025 1 6 2025 north vinod

D014 surveillance 210 85 2 6 99 2 14 2025 2 14 2025 south arun

D015 defense 350 115 1 13 101 3 28 2025 3 28 2025 west lokesh

;

run;

proc print data=drone_raw;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_Date
1D001surveillance12080259811520251152025southramesh15JAN202515JAN2025
2D002delivery2001100810521020252102025northsuresh10FEB202510FEB2025
3D003agriculture906051085352025362025eastkumar05MAR202506MAR2025
4D004defense30095-1129942020254202025westrajesh20APR202520APR2025
5D005surveillance150753610151120255112025southanil11MAY202511MAY2025
6D006delivery220851796612025612025northpradeep01JUN202501JUN2025
7D007agriculture13055498871920257202025eastsandeep19JUL202520JUL2025
8D008defense40012001510082220258222025westmanoj22AUG202522AUG2025
9D009delivery50201036091020259102025northajay10SEP202510SEP2025
10D010surveillance1707025971015202510152025southmahesh15OCT202515OCT2025
11D011agriculture956568841112202511132025eastnaresh12NOV202513NOV2025
12D012defense2801000141021225202512252025westrakesh25DEC202525DEC2025
13D013delivery180903793152025162025northvinod05JAN202506JAN2025
14D014surveillance21085269921420252142025southarun14FEB202514FEB2025
15D015defense35011511310132820253282025westlokesh28MAR202528MAR2025

What Are The Errors?

·  Battery_Usage > 100 (D002, D008, D015)

·  Success_Rate > 100 (D002, D005, D012, D015)

·  Negative Navigation_Errors (D004)

·  Landing_Date = Launch_Date (No duration)

·  Extra spaces not handled

·  Operator names not standardized

2. Corrected Dataset Full Version

data drone_clean;

set drone_raw;

Drone_ID = strip(upcase(Drone_ID));

Mission_Type = propcase(strip(Mission_Type));

Region = upcase(strip(Region));

Operator_Name = propcase(strip(Operator_Name));

if Battery_Usage > 100 then Battery_Usage = 100;

if Battery_Usage < 0 then Battery_Usage = 0;

if Success_Rate > 100 then Success_Rate = 100;

if Success_Rate < 0 then Success_Rate = 0;

if Navigation_Errors < 0 then Navigation_Errors = 0;

Flight_Duration_Days = intck('day',Launch_Date,Landing_Date);

Expected_Landing = intnx('day',Launch_Date,1);

format Expected_Landing date9.;

length Utilization_Class $8.;

if Flight_Time > 300 then Utilization_Class="High";

else if Flight_Time >150 then Utilization_Class="Medium";

else Utilization_Class="Low";

Fraud_Flag=0;

run;

proc print data=drone_clean;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_Flag
1D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low0
2D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium0
3D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0
4D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium0
5D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low0
6D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium0
7D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0
8D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High0
9D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low0
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium0
11D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0
12D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium0
13D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0
14D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium0
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High0

SET drone_raw;

Reads existing dataset.

STRIP

Removes leading and trailing spaces.

UPCASE

Converts to uppercase.

PROPCASE

Makes first letter capital.

IF Battery_Usage > 100

Business rule validation.

INTCK

Calculates date difference.

INTNX

Adds interval to date.

FORMAT

Applies readable date format.

3. Fraud Detection Macro

%macro fraud_check;

data drone_final;

set drone_clean;

if Battery_Usage > 95 and Flight_Time < 60 then Fraud_Flag=1;

if Navigation_Errors=0 and Success_Rate=100 then Fraud_Flag=1;

if Flight_Duration_Days=0 then Fraud_Flag=1;

run;

proc print data=drone_final;

run;

%mend;


%fraud_check;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_Flag
1D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1
2D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1
3D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0
4D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1
5D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1
6D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1
7D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0
8D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1
9D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1
11D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0
12D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1
13D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0
14D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1

·  Reusable logic

·  Centralized validation

·  Easy updates

·  Production ready

Fraud Detection Framework

Fraud detection logic is built around business intelligence rules such as:

·       High battery usage + low flight time

·       Zero navigation errors + perfect success rate

·       Long-duration missions with minimal payload

·       Identical repeated performance metrics

·       Zero-duration flights

Fraud flags are designed at:

·       Flight level

·       Drone (subject) level

This ensures multi-level risk visibility.

Fraud logic must be:

·       Modular

·       Reusable

·       Documented

·       Auditable

4. Region Classification Dataset

data region_info;

input Region $ Zone $;

datalines;

NORTH Zone1

SOUTH Zone2

EAST Zone3

WEST Zone4

;

run;

proc print data=region_info;

run;

OUTPUT:

ObsRegionZone
1NORTHZone1
2SOUTHZone2
3EASTZone3
4WESTZone4

5. Merge

proc sort data=drone_final; by Region; run;

proc print data=drone_final;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_Flag
1D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0
2D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0
3D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0
4D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1
5D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1
6D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1
7D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0
8D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1
9D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1
11D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1
12D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1
13D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1
14D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1

proc sort data=region_info; by Region; run;

proc print data=region_info;

run;

OUTPUT:

ObsRegionZone
1EASTZone3
2NORTHZone1
3SOUTHZone2
4WESTZone4

data drone_merged;

merge drone_final region_info;

by Region;

run;

proc print data=drone_merged;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_FlagZone
1D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0Zone3
2D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0Zone3
3D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0Zone3
4D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1Zone1
5D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1Zone1
6D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1Zone1
7D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0Zone1
8D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1Zone2
9D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1Zone2
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1Zone2
11D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1Zone2
12D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1Zone4
13D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1Zone4
14D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1Zone4
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1Zone4

6. PROC APPEND

proc append base=drone_merged

            data=drone_final force;

run;

proc print data=drone_merged;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_FlagZone
1D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0Zone3
2D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0Zone3
3D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0Zone3
4D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1Zone1
5D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1Zone1
6D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1Zone1
7D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0Zone1
8D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1Zone2
9D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1Zone2
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1Zone2
11D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1Zone2
12D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1Zone4
13D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1Zone4
14D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1Zone4
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1Zone4
16D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0 
17D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0 
18D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0 
19D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1 
20D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1 
21D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1 
22D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0 
23D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1 
24D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1 
25D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1 
26D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1 
27D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1 
28D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1 
29D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1 
30D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1 

7. PROC TRANSPOSE

proc sort data=drone_final; by Drone_ID; run;

proc print data=drone_final;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_Flag
1D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low1
2D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1
3D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low0
4D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium1
5D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1
6D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium1
7D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low0
8D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1
9D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low1
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium1
11D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low0
12D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1
13D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium0
14D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium1
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1


proc transpose data=drone_final out=drone_trans;

by Drone_ID;

var Flight_Time Battery_Usage Success_Rate;

run;

proc print data=drone_trans;

run;

OUTPUT:

ObsDrone_ID_NAME_COL1
1D001Flight_Time120
2D001Battery_Usage80
3D001Success_Rate98
4D002Flight_Time200
5D002Battery_Usage100
6D002Success_Rate100
7D003Flight_Time90
8D003Battery_Usage60
9D003Success_Rate85
10D004Flight_Time300
11D004Battery_Usage95
12D004Success_Rate99
13D005Flight_Time150
14D005Battery_Usage75
15D005Success_Rate100
16D006Flight_Time220
17D006Battery_Usage85
18D006Success_Rate96
19D007Flight_Time130
20D007Battery_Usage55
21D007Success_Rate88
22D008Flight_Time400
23D008Battery_Usage100
24D008Success_Rate100
25D009Flight_Time50
26D009Battery_Usage20
27D009Success_Rate60
28D010Flight_Time170
29D010Battery_Usage70
30D010Success_Rate97
31D011Flight_Time95
32D011Battery_Usage65
33D011Success_Rate84
34D012Flight_Time280
35D012Battery_Usage100
36D012Success_Rate100
37D013Flight_Time180
38D013Battery_Usage90
39D013Success_Rate93
40D014Flight_Time210
41D014Battery_Usage85
42D014Success_Rate99
43D015Flight_Time350
44D015Battery_Usage100
45D015Success_Rate100

8. COALESCE 

data drone_coalesce;

set drone_final;

Adjusted_Success = coalesce(Success_Rate,0);

run;

proc print data=drone_coalesce;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_MonthLaunch_DayLaunch_YearLanding_MonthLanding_DayLanding_YearRegionOperator_NameLaunch_DateLanding_DateFlight_Duration_DaysExpected_LandingUtilization_ClassFraud_FlagAdjusted_Success
1D001Surveillance12080259811520251152025SOUTHRamesh15JAN202515JAN2025016JAN2025Low198
2D002Delivery2001000810021020252102025NORTHSuresh10FEB202510FEB2025011FEB2025Medium1100
3D003Agriculture906051085352025362025EASTKumar05MAR202506MAR2025106MAR2025Low085
4D004Defense300950129942020254202025WESTRajesh20APR202520APR2025021APR2025Medium199
5D005Surveillance150753610051120255112025SOUTHAnil11MAY202511MAY2025012MAY2025Low1100
6D006Delivery220851796612025612025NORTHPradeep01JUN202501JUN2025002JUN2025Medium196
7D007Agriculture13055498871920257202025EASTSandeep19JUL202520JUL2025120JUL2025Low088
8D008Defense40010001510082220258222025WESTManoj22AUG202522AUG2025023AUG2025High1100
9D009Delivery50201036091020259102025NORTHAjay10SEP202510SEP2025011SEP2025Low160
10D010Surveillance1707025971015202510152025SOUTHMahesh15OCT202515OCT2025016OCT2025Medium197
11D011Agriculture956568841112202511132025EASTNaresh12NOV202513NOV2025113NOV2025Low084
12D012Defense2801000141001225202512252025WESTRakesh25DEC202525DEC2025026DEC2025Medium1100
13D013Delivery180903793152025162025NORTHVinod05JAN202506JAN2025106JAN2025Medium093
14D014Surveillance21085269921420252142025SOUTHArun14FEB202514FEB2025015FEB2025Medium199
15D015Defense35010011310032820253282025WESTLokesh28MAR202528MAR2025029MAR2025High1100

9. PROC DATASETS DELETE

proc datasets library=work nolist;

delete drone_raw drone_clean;

quit;

LOG:

NOTE: Deleting WORK.DRONE_RAW (memtype=DATA).
NOTE: Deleting WORK.DRONE_CLEAN (memtype=DATA).

ADAM STARTS:

1. Source Dataset (Operational Data)

data drone_operational;

input Drone_ID $ Mission_Type:$18. Flight_Time Battery_Usage Navigation_Errors 

      Payload_Weight Success_Rate Launch_Date :date9. 

      Landing_Date :date9. Region $ Operator_Name $;

format Launch_Date Landing_Date date9.;

datalines;

D001 Surveillance 120 80 2 5 98 15JAN2025 16JAN2025 SOUTH Ramesh

D002 Delivery 200 95 0 8 100 10FEB2025 10FEB2025 NORTH Suresh

D003 Agriculture 90 60 5 10 85 05MAR2025 06MAR2025 EAST Kumar

D004 Defense 300 95 0 12 99 20APR2025 20APR2025 WEST Rajesh

D005 Surveillance 150 75 3 6 97 11MAY2025 11MAY2025 SOUTH Anil

D006 Delivery 220 85 1 7 96 01JUN2025 02JUN2025 NORTH Pradeep

D007 Agriculture 130 55 4 9 88 19JUL2025 20JUL2025 EAST Sandeep

D008 Defense 400 100 0 15 100 22AUG2025 22AUG2025 WEST Manoj

D009 Delivery 50 20 10 3 60 10SEP2025 10SEP2025 NORTH Ajay

D010 Surveillance 170 70 2 5 97 15OCT2025 16OCT2025 SOUTH Mahesh

D011 Agriculture 95 65 6 8 84 12NOV2025 13NOV2025 EAST Naresh

D012 Defense 280 100 0 14 100 25DEC2025 25DEC2025 WEST Rakesh

D013 Delivery 180 90 3 7 93 05JAN2025 06JAN2025 NORTH Vinod

D014 Surveillance 210 85 2 6 99 14FEB2025 15FEB2025 SOUTH Arun

D015 Defense 350 100 1 13 100 28MAR2025 28MAR2025 WEST Lokesh

;

run;

proc print data=drone_operational;

run;

OUTPUT:

ObsDrone_IDMission_TypeFlight_TimeBattery_UsageNavigation_ErrorsPayload_WeightSuccess_RateLaunch_DateLanding_DateRegionOperator_Name
1D001Surveillance12080259815JAN202516JAN2025SOUTHRamesh
2D002Delivery200950810010FEB202510FEB2025NORTHSuresh
3D003Agriculture90605108505MAR202506MAR2025EASTKumar
4D004Defense300950129920APR202520APR2025WESTRajesh
5D005Surveillance15075369711MAY202511MAY2025SOUTHAnil
6D006Delivery22085179601JUN202502JUN2025NORTHPradeep
7D007Agriculture13055498819JUL202520JUL2025EASTSandeep
8D008Defense40010001510022AUG202522AUG2025WESTManoj
9D009Delivery50201036010SEP202510SEP2025NORTHAjay
10D010Surveillance17070259715OCT202516OCT2025SOUTHMahesh
11D011Agriculture9565688412NOV202513NOV2025EASTNaresh
12D012Defense28010001410025DEC202525DEC2025WESTRakesh
13D013Delivery18090379305JAN202506JAN2025NORTHVinod
14D014Surveillance21085269914FEB202515FEB2025SOUTHArun
15D015Defense35010011310028MAR202528MAR2025WESTLokesh

2. Create ADSL_DRONE (Subject-Level Dataset)

Concept:

One record per Drone_ID.

Derived variables:

·  TRT01P → Primary mission category

·  TOT_FLIGHT_TIME

·  AVG_SUCCESS_RATE

·  MAX_BATTERY_USAGE

·  FRAUD_ANYFL


proc sql;

create table ADSL_DRONE as

select 

    Drone_ID as USUBJID,

    upcase(Region) as REGION,

    propcase(Mission_Type) as TRT01P,

    sum(Flight_Time) as TOTFLTIME,

    mean(Success_Rate) as AVGSUCC,

    max(Battery_Usage) as MAXBAT,

    count(*) as TOTFLIGHTS

from drone_operational

group by Drone_ID, Region, Mission_Type;

quit;

proc print data=ADSL_DRONE;

run;

OUTPUT:

ObsUSUBJIDREGIONTRT01PTOTFLTIMEAVGSUCCMAXBATTOTFLIGHTS
1D001SOUTHSurveillance12098801
2D002NORTHDelivery200100951
3D003EASTAgriculture9085601
4D004WESTDefense30099951
5D005SOUTHSurveillance15097751
6D006NORTHDelivery22096851
7D007EASTAgriculture13088551
8D008WESTDefense4001001001
9D009NORTHDelivery5060201
10D010SOUTHSurveillance17097701
11D011EASTAgriculture9584651
12D012WESTDefense2801001001
13D013NORTHDelivery18093901
14D014SOUTHSurveillance21099851
15D015WESTDefense3501001001

USUBJID

ADaM requires unique subject ID.

TRT01P

Treatment variable equivalent → Mission type.

TOTFLTIME

Total exposure (like treatment duration).

AVGSUCC

Mean success rate.

MAXBAT

Worst-case battery utilization.

3. Add Fraud Flag to ADSL

data ADSL_DRONE;

set ADSL_DRONE;

if MAXBAT=100 and AVGSUCC=100 then FRAUD_ANYFL="Y";

else FRAUD_ANYFL="N";

run;

proc print data=ADSL_DRONE;

run;

OUTPUT:

ObsUSUBJIDREGIONTRT01PTOTFLTIMEAVGSUCCMAXBATTOTFLIGHTSFRAUD_ANYFL
1D001SOUTHSurveillance12098801N
2D002NORTHDelivery200100951N
3D003EASTAgriculture9085601N
4D004WESTDefense30099951N
5D005SOUTHSurveillance15097751N
6D006NORTHDelivery22096851N
7D007EASTAgriculture13088551N
8D008WESTDefense4001001001Y
9D009NORTHDelivery5060201N
10D010SOUTHSurveillance17097701N
11D011EASTAgriculture9584651N
12D012WESTDefense2801001001Y
13D013NORTHDelivery18093901N
14D014SOUTHSurveillance21099851N
15D015WESTDefense3501001001Y

4. Create ADFLIGHT (Flight-Level ADaM Dataset)

·  Structure similar to ADVS.

data ADFLIGHT;

set drone_operational;

USUBJID = Drone_ID;

PARAMCD="FLTTIME";

PARAM="Flight Time (Minutes)";

AVAL=Flight_Time;

AVALC=strip(put(Flight_Time,8.));

ADT=Launch_Date;

ADY=intck('day',min(Launch_Date),Launch_Date)+1;

ANLFL="Y";

output;


PARAMCD="BATUSE";

PARAM="Battery Usage (%)";

AVAL=Battery_Usage;

AVALC=strip(put(Battery_Usage,8.));

output;


PARAMCD="SUCRATE";

PARAM="Success Rate (%)";

AVAL=Success_Rate;

AVALC=strip(put(Success_Rate,8.));

output;

keep USUBJID PARAMCD PARAM AVAL AVALC ADT ADY ANLFL;

run;

proc print data=ADFLIGHT;

run;

OUTPUT:

ObsUSUBJIDPARAMCDPARAMAVALAVALCADTADYANLFL
1D001FLTTIMEFlight Time (Minutes)120120237561Y
2D001BATUSEBattery Usage (%)8080237561Y
3D001SUCRATESuccess Rate (%)9898237561Y
4D002FLTTIMEFlight Time (Minutes)200200237821Y
5D002BATUSEBattery Usage (%)9595237821Y
6D002SUCRATESuccess Rate (%)100100237821Y
7D003FLTTIMEFlight Time (Minutes)9090238051Y
8D003BATUSEBattery Usage (%)6060238051Y
9D003SUCRATESuccess Rate (%)8585238051Y
10D004FLTTIMEFlight Time (Minutes)300300238511Y
11D004BATUSEBattery Usage (%)9595238511Y
12D004SUCRATESuccess Rate (%)9999238511Y
13D005FLTTIMEFlight Time (Minutes)150150238721Y
14D005BATUSEBattery Usage (%)7575238721Y
15D005SUCRATESuccess Rate (%)9797238721Y
16D006FLTTIMEFlight Time (Minutes)220220238931Y
17D006BATUSEBattery Usage (%)8585238931Y
18D006SUCRATESuccess Rate (%)9696238931Y
19D007FLTTIMEFlight Time (Minutes)130130239411Y
20D007BATUSEBattery Usage (%)5555239411Y
21D007SUCRATESuccess Rate (%)8888239411Y
22D008FLTTIMEFlight Time (Minutes)400400239751Y
23D008BATUSEBattery Usage (%)100100239751Y
24D008SUCRATESuccess Rate (%)100100239751Y
25D009FLTTIMEFlight Time (Minutes)5050239941Y
26D009BATUSEBattery Usage (%)2020239941Y
27D009SUCRATESuccess Rate (%)6060239941Y
28D010FLTTIMEFlight Time (Minutes)170170240291Y
29D010BATUSEBattery Usage (%)7070240291Y
30D010SUCRATESuccess Rate (%)9797240291Y
31D011FLTTIMEFlight Time (Minutes)9595240571Y
32D011BATUSEBattery Usage (%)6565240571Y
33D011SUCRATESuccess Rate (%)8484240571Y
34D012FLTTIMEFlight Time (Minutes)280280241001Y
35D012BATUSEBattery Usage (%)100100241001Y
36D012SUCRATESuccess Rate (%)100100241001Y
37D013FLTTIMEFlight Time (Minutes)180180237461Y
38D013BATUSEBattery Usage (%)9090237461Y
39D013SUCRATESuccess Rate (%)9393237461Y
40D014FLTTIMEFlight Time (Minutes)210210237861Y
41D014BATUSEBattery Usage (%)8585237861Y
42D014SUCRATESuccess Rate (%)9999237861Y
43D015FLTTIMEFlight Time (Minutes)350350238281Y
44D015BATUSEBattery Usage (%)100100238281Y
45D015SUCRATESuccess Rate (%)100100238281Y

Why Multiple Output?

ADaM analysis datasets are parameter-level structured.

Each flight generates multiple parameter records:

  • Flight Time
  • Battery Usage
  • Success Rate

5. Derive Additional Analysis Variables

data ADFLIGHT;

set ADFLIGHT;

if AVAL >= 300 and PARAMCD="FLTTIME" then HIGHFL="Y";

else HIGHFL="N";

if PARAMCD="SUCRATE" and AVAL=100 then PERFECTFL="Y";

else PERFECTFL="N";

run;

proc print data=ADFLIGHT;

run;

OUTPUT:

ObsUSUBJIDPARAMCDPARAMAVALAVALCADTADYANLFLHIGHFLPERFECTFL
1D001FLTTIMEFlight Time (Minutes)120120237561YNN
2D001BATUSEBattery Usage (%)8080237561YNN
3D001SUCRATESuccess Rate (%)9898237561YNN
4D002FLTTIMEFlight Time (Minutes)200200237821YNN
5D002BATUSEBattery Usage (%)9595237821YNN
6D002SUCRATESuccess Rate (%)100100237821YNY
7D003FLTTIMEFlight Time (Minutes)9090238051YNN
8D003BATUSEBattery Usage (%)6060238051YNN
9D003SUCRATESuccess Rate (%)8585238051YNN
10D004FLTTIMEFlight Time (Minutes)300300238511YYN
11D004BATUSEBattery Usage (%)9595238511YNN
12D004SUCRATESuccess Rate (%)9999238511YNN
13D005FLTTIMEFlight Time (Minutes)150150238721YNN
14D005BATUSEBattery Usage (%)7575238721YNN
15D005SUCRATESuccess Rate (%)9797238721YNN
16D006FLTTIMEFlight Time (Minutes)220220238931YNN
17D006BATUSEBattery Usage (%)8585238931YNN
18D006SUCRATESuccess Rate (%)9696238931YNN
19D007FLTTIMEFlight Time (Minutes)130130239411YNN
20D007BATUSEBattery Usage (%)5555239411YNN
21D007SUCRATESuccess Rate (%)8888239411YNN
22D008FLTTIMEFlight Time (Minutes)400400239751YYN
23D008BATUSEBattery Usage (%)100100239751YNN
24D008SUCRATESuccess Rate (%)100100239751YNY
25D009FLTTIMEFlight Time (Minutes)5050239941YNN
26D009BATUSEBattery Usage (%)2020239941YNN
27D009SUCRATESuccess Rate (%)6060239941YNN
28D010FLTTIMEFlight Time (Minutes)170170240291YNN
29D010BATUSEBattery Usage (%)7070240291YNN
30D010SUCRATESuccess Rate (%)9797240291YNN
31D011FLTTIMEFlight Time (Minutes)9595240571YNN
32D011BATUSEBattery Usage (%)6565240571YNN
33D011SUCRATESuccess Rate (%)8484240571YNN
34D012FLTTIMEFlight Time (Minutes)280280241001YNN
35D012BATUSEBattery Usage (%)100100241001YNN
36D012SUCRATESuccess Rate (%)100100241001YNY
37D013FLTTIMEFlight Time (Minutes)180180237461YNN
38D013BATUSEBattery Usage (%)9090237461YNN
39D013SUCRATESuccess Rate (%)9393237461YNN
40D014FLTTIMEFlight Time (Minutes)210210237861YNN
41D014BATUSEBattery Usage (%)8585237861YNN
42D014SUCRATESuccess Rate (%)9999237861YNN
43D015FLTTIMEFlight Time (Minutes)350350238281YYN
44D015BATUSEBattery Usage (%)100100238281YNN
45D015SUCRATESuccess Rate (%)100100238281YNY

6. Utilization Classification

data ADFLIGHT;

set ADFLIGHT;

if PARAMCD="FLTTIME" then do;

length UTILCLASS $8.;

   if AVAL>300 then UTILCLASS="High";

   else if AVAL>150 then UTILCLASS="Medium";

   else UTILCLASS="Low";

end;

run;

proc print data=ADFLIGHT;

run;

OUTPUT:

ObsUSUBJIDPARAMCDPARAMAVALAVALCADTADYANLFLHIGHFLPERFECTFLUTILCLASS
1D001FLTTIMEFlight Time (Minutes)120120237561YNNLow
2D001BATUSEBattery Usage (%)8080237561YNN 
3D001SUCRATESuccess Rate (%)9898237561YNN 
4D002FLTTIMEFlight Time (Minutes)200200237821YNNMedium
5D002BATUSEBattery Usage (%)9595237821YNN 
6D002SUCRATESuccess Rate (%)100100237821YNY 
7D003FLTTIMEFlight Time (Minutes)9090238051YNNLow
8D003BATUSEBattery Usage (%)6060238051YNN 
9D003SUCRATESuccess Rate (%)8585238051YNN 
10D004FLTTIMEFlight Time (Minutes)300300238511YYNMedium
11D004BATUSEBattery Usage (%)9595238511YNN 
12D004SUCRATESuccess Rate (%)9999238511YNN 
13D005FLTTIMEFlight Time (Minutes)150150238721YNNLow
14D005BATUSEBattery Usage (%)7575238721YNN 
15D005SUCRATESuccess Rate (%)9797238721YNN 
16D006FLTTIMEFlight Time (Minutes)220220238931YNNMedium
17D006BATUSEBattery Usage (%)8585238931YNN 
18D006SUCRATESuccess Rate (%)9696238931YNN 
19D007FLTTIMEFlight Time (Minutes)130130239411YNNLow
20D007BATUSEBattery Usage (%)5555239411YNN 
21D007SUCRATESuccess Rate (%)8888239411YNN 
22D008FLTTIMEFlight Time (Minutes)400400239751YYNHigh
23D008BATUSEBattery Usage (%)100100239751YNN 
24D008SUCRATESuccess Rate (%)100100239751YNY 
25D009FLTTIMEFlight Time (Minutes)5050239941YNNLow
26D009BATUSEBattery Usage (%)2020239941YNN 
27D009SUCRATESuccess Rate (%)6060239941YNN 
28D010FLTTIMEFlight Time (Minutes)170170240291YNNMedium
29D010BATUSEBattery Usage (%)7070240291YNN 
30D010SUCRATESuccess Rate (%)9797240291YNN 
31D011FLTTIMEFlight Time (Minutes)9595240571YNNLow
32D011BATUSEBattery Usage (%)6565240571YNN 
33D011SUCRATESuccess Rate (%)8484240571YNN 
34D012FLTTIMEFlight Time (Minutes)280280241001YNNMedium
35D012BATUSEBattery Usage (%)100100241001YNN 
36D012SUCRATESuccess Rate (%)100100241001YNY 
37D013FLTTIMEFlight Time (Minutes)180180237461YNNMedium
38D013BATUSEBattery Usage (%)9090237461YNN 
39D013SUCRATESuccess Rate (%)9393237461YNN 
40D014FLTTIMEFlight Time (Minutes)210210237861YNNMedium
41D014BATUSEBattery Usage (%)8585237861YNN 
42D014SUCRATESuccess Rate (%)9999237861YNN 
43D015FLTTIMEFlight Time (Minutes)350350238281YYNHigh
44D015BATUSEBattery Usage (%)100100238281YNN 
45D015SUCRATESuccess Rate (%)100100238281YNY 

7. Merge ADSL into ADFLIGHT

proc sort data=ADSL_DRONE; by USUBJID; run;

proc print data=ADSL_DRONE;

run;

OUTPUT:

ObsUSUBJIDREGIONTRT01PTOTFLTIMEAVGSUCCMAXBATTOTFLIGHTSFRAUD_ANYFL
1D001SOUTHSurveillance12098801N
2D002NORTHDelivery200100951N
3D003EASTAgriculture9085601N
4D004WESTDefense30099951N
5D005SOUTHSurveillance15097751N
6D006NORTHDelivery22096851N
7D007EASTAgriculture13088551N
8D008WESTDefense4001001001Y
9D009NORTHDelivery5060201N
10D010SOUTHSurveillance17097701N
11D011EASTAgriculture9584651N
12D012WESTDefense2801001001Y
13D013NORTHDelivery18093901N
14D014SOUTHSurveillance21099851N
15D015WESTDefense3501001001Y

proc sort data=ADFLIGHT; by USUBJID; run;

proc print data=ADFLIGHT;

run;

OUTPUT:

ObsUSUBJIDPARAMCDPARAMAVALAVALCADTADYANLFLHIGHFLPERFECTFLUTILCLASS
1D001FLTTIMEFlight Time (Minutes)120120237561YNNLow
2D001BATUSEBattery Usage (%)8080237561YNN 
3D001SUCRATESuccess Rate (%)9898237561YNN 
4D002FLTTIMEFlight Time (Minutes)200200237821YNNMedium
5D002BATUSEBattery Usage (%)9595237821YNN 
6D002SUCRATESuccess Rate (%)100100237821YNY 
7D003FLTTIMEFlight Time (Minutes)9090238051YNNLow
8D003BATUSEBattery Usage (%)6060238051YNN 
9D003SUCRATESuccess Rate (%)8585238051YNN 
10D004FLTTIMEFlight Time (Minutes)300300238511YYNMedium
11D004BATUSEBattery Usage (%)9595238511YNN 
12D004SUCRATESuccess Rate (%)9999238511YNN 
13D005FLTTIMEFlight Time (Minutes)150150238721YNNLow
14D005BATUSEBattery Usage (%)7575238721YNN 
15D005SUCRATESuccess Rate (%)9797238721YNN 
16D006FLTTIMEFlight Time (Minutes)220220238931YNNMedium
17D006BATUSEBattery Usage (%)8585238931YNN 
18D006SUCRATESuccess Rate (%)9696238931YNN 
19D007FLTTIMEFlight Time (Minutes)130130239411YNNLow
20D007BATUSEBattery Usage (%)5555239411YNN 
21D007SUCRATESuccess Rate (%)8888239411YNN 
22D008FLTTIMEFlight Time (Minutes)400400239751YYNHigh
23D008BATUSEBattery Usage (%)100100239751YNN 
24D008SUCRATESuccess Rate (%)100100239751YNY 
25D009FLTTIMEFlight Time (Minutes)5050239941YNNLow
26D009BATUSEBattery Usage (%)2020239941YNN 
27D009SUCRATESuccess Rate (%)6060239941YNN 
28D010FLTTIMEFlight Time (Minutes)170170240291YNNMedium
29D010BATUSEBattery Usage (%)7070240291YNN 
30D010SUCRATESuccess Rate (%)9797240291YNN 
31D011FLTTIMEFlight Time (Minutes)9595240571YNNLow
32D011BATUSEBattery Usage (%)6565240571YNN 
33D011SUCRATESuccess Rate (%)8484240571YNN 
34D012FLTTIMEFlight Time (Minutes)280280241001YNNMedium
35D012BATUSEBattery Usage (%)100100241001YNN 
36D012SUCRATESuccess Rate (%)100100241001YNY 
37D013FLTTIMEFlight Time (Minutes)180180237461YNNMedium
38D013BATUSEBattery Usage (%)9090237461YNN 
39D013SUCRATESuccess Rate (%)9393237461YNN 
40D014FLTTIMEFlight Time (Minutes)210210237861YNNMedium
41D014BATUSEBattery Usage (%)8585237861YNN 
42D014SUCRATESuccess Rate (%)9999237861YNN 
43D015FLTTIMEFlight Time (Minutes)350350238281YYNHigh
44D015BATUSEBattery Usage (%)100100238281YNN 
45D015SUCRATESuccess Rate (%)100100238281YNY 

data ADFLIGHT_FINAL;

merge ADFLIGHT ADSL_DRONE(keep=USUBJID FRAUD_ANYFL);

by USUBJID;

run;

proc print data=ADFLIGHT_FINAL;

run;

OUTPUT:

ObsUSUBJIDPARAMCDPARAMAVALAVALCADTADYANLFLHIGHFLPERFECTFLUTILCLASSFRAUD_ANYFL
1D001FLTTIMEFlight Time (Minutes)120120237561YNNLowN
2D001BATUSEBattery Usage (%)8080237561YNN N
3D001SUCRATESuccess Rate (%)9898237561YNN N
4D002FLTTIMEFlight Time (Minutes)200200237821YNNMediumN
5D002BATUSEBattery Usage (%)9595237821YNN N
6D002SUCRATESuccess Rate (%)100100237821YNY N
7D003FLTTIMEFlight Time (Minutes)9090238051YNNLowN
8D003BATUSEBattery Usage (%)6060238051YNN N
9D003SUCRATESuccess Rate (%)8585238051YNN N
10D004FLTTIMEFlight Time (Minutes)300300238511YYNMediumN
11D004BATUSEBattery Usage (%)9595238511YNN N
12D004SUCRATESuccess Rate (%)9999238511YNN N
13D005FLTTIMEFlight Time (Minutes)150150238721YNNLowN
14D005BATUSEBattery Usage (%)7575238721YNN N
15D005SUCRATESuccess Rate (%)9797238721YNN N
16D006FLTTIMEFlight Time (Minutes)220220238931YNNMediumN
17D006BATUSEBattery Usage (%)8585238931YNN N
18D006SUCRATESuccess Rate (%)9696238931YNN N
19D007FLTTIMEFlight Time (Minutes)130130239411YNNLowN
20D007BATUSEBattery Usage (%)5555239411YNN N
21D007SUCRATESuccess Rate (%)8888239411YNN N
22D008FLTTIMEFlight Time (Minutes)400400239751YYNHighY
23D008BATUSEBattery Usage (%)100100239751YNN Y
24D008SUCRATESuccess Rate (%)100100239751YNY Y
25D009FLTTIMEFlight Time (Minutes)5050239941YNNLowN
26D009BATUSEBattery Usage (%)2020239941YNN N
27D009SUCRATESuccess Rate (%)6060239941YNN N
28D010FLTTIMEFlight Time (Minutes)170170240291YNNMediumN
29D010BATUSEBattery Usage (%)7070240291YNN N
30D010SUCRATESuccess Rate (%)9797240291YNN N
31D011FLTTIMEFlight Time (Minutes)9595240571YNNLowN
32D011BATUSEBattery Usage (%)6565240571YNN N
33D011SUCRATESuccess Rate (%)8484240571YNN N
34D012FLTTIMEFlight Time (Minutes)280280241001YNNMediumY
35D012BATUSEBattery Usage (%)100100241001YNN Y
36D012SUCRATESuccess Rate (%)100100241001YNY Y
37D013FLTTIMEFlight Time (Minutes)180180237461YNNMediumN
38D013BATUSEBattery Usage (%)9090237461YNN N
39D013SUCRATESuccess Rate (%)9393237461YNN N
40D014FLTTIMEFlight Time (Minutes)210210237861YNNMediumN
41D014BATUSEBattery Usage (%)8585237861YNN N
42D014SUCRATESuccess Rate (%)9999237861YNN N
43D015FLTTIMEFlight Time (Minutes)350350238281YYNHighY
44D015BATUSEBattery Usage (%)100100238281YNN Y
45D015SUCRATESuccess Rate (%)100100238281YNY Y

Final ADaM Structure

ADSL_DRONE

Variable

Purpose

USUBJID

Unique Drone

REGION

Region

TRT01P

Mission

TOTFLTIME

Total flight exposure

AVGSUCC

Mean success

MAXBAT

Max battery

TOTFLIGHTS

Total missions

FRAUD_ANYFL

Subject-level fraud flag

ADFLIGHT_FINAL

Variable

Purpose

USUBJID

Drone ID

PARAMCD

Parameter Code

PARAM

Parameter Description

AVAL

Numeric value

AVALC

Character value

ADT

Analysis Date

ADY

Analysis Day

ANLFL

Analysis Flag

HIGHFL

High Flight Flag

PERFECTFL

Perfect Success Flag

UTILCLASS

Utilization Class

FRAUD_ANYFL

Drone-level fraud


Transition to ADaM Principles

After operational validation and fraud detection, the system transitions into an analysis-ready structured framework inspired by ADaM principles.

ADaM philosophy includes:

·       One record per subject (Drone)

·       One record per parameter per visit (Flight)

·       Clear traceability

·       Derived variables documented

·       Analysis flags defined

·       Numeric analysis values standardized

This ensures:

·       Statistical readiness

·       Reproducibility

·       Transparency

·       Audit support

ADSL_DRONE (Subject-Level Design)

In this framework:

Each Drone_ID becomes a subject (USUBJID).

Subject-level variables include:

·       Total Flight Time

·       Average Success Rate

·       Maximum Battery Usage

·       Total Flights

·       Region

·       Primary Mission

·       Subject-Level Fraud Flag

This mirrors ADSL in clinical trials, where subject-level exposure and summary metrics are derived.

The purpose:

·       Enable summary reporting

·       Enable grouping by region

·       Support aggregated risk scoring

ADFLIGHT (Parameter-Level Design)

Each flight generates multiple parameter records:

·       Flight Time

·       Battery Usage

·       Success Rate

Each parameter record includes:

·       Parameter Code (PARAMCD)

·       Parameter Description (PARAM)

·       Numeric Analysis Value (AVAL)

·       Analysis Date (ADT)

·       Analysis Day (ADY)

·       Analysis Flag (ANLFL)

·       Fraud Flag

This structure enables:

·       Time-based modeling

·       Threshold analysis

·       Cross-parameter comparisons

·       Reporting consistency

Traceability & Analysis Flags

Traceability ensures:

·       Every derived variable can be traced to source fields

·       Fraud logic is documented

·       Date derivations are reproducible

·       Summary values reconcile with raw totals

Analysis flags define:

·       Which records are analysis-ready

·       Which values are considered valid

·       Which flights triggered fraud detection

Traceability = Audit confidence.

25 Key Project Insights

1.     Raw operational data is rarely reliable.

2.     Validation must precede modeling.

3.     Date derivation adds analytical depth.

4.     Fraud logic must reflect business reality.

5.     Perfect performance is statistically suspicious.

6.     Zero-duration missions indicate manipulation.

7.     High battery with low time signals anomaly.

8.     Modular logic supports scalability.

9.     Structured datasets improve reporting.

10.  Subject-level summaries enable trend tracking.

11.  Parameter-level design improves flexibility.

12.  Traceability prevents audit failures.

13.  Data reshaping enables statistical modeling.

14.  Dataset governance prevents duplication errors.

15.  Case standardization avoids merge mismatches.

16.  Automated fraud flags reduce manual review.

17.  Threshold validation enforces engineering limits.

18.  Derived metrics improve decision-making.

19.  Longitudinal data reveals hidden patterns.

20.  ADaM principles apply beyond clinical trials.

21.  Clear documentation enhances credibility.

22.  Business logic must align with engineering logic.

23.  Clean data increases model reliability.

24.  Multi-level fraud detection improves control.

25.  Production systems require both engineering and analytics discipline.

Business Interpretation

From a risk perspective:

·       High battery usage + low flight duration = possible manipulation

·       Perfect success rate + zero errors = statistically improbable

·       Long missions with zero navigation errors = risk indicator

·       Same-day launch and landing for multi-hour missions = suspicious

When fraud detection is embedded within structured analytics:

·       Operational oversight improves

·       Risk scoring becomes systematic

·       Regional performance can be audited

·       Management receives credible reports

This system bridges operations and governance.

Conclusion:

This project demonstrates how a complete autonomous drone flight analytics system can be designed with both operational control and analytical rigor. We moved beyond simple dataset creation and built a structured framework that includes data ingestion, validation, debugging, fraud detection logic, and structured transformation. By applying business rules, temporal derivations, and anomaly detection principles, we ensured that unreliable or manipulated records are identified early in the process.

The integration of ADaM-inspired subject-level and parameter-level structures further enhances traceability, audit readiness, and reporting flexibility. Fraud flags at both flight and drone levels provide multi-layered risk visibility. This combined engineering and analytical approach reflects real-world enterprise standards, where data governance, reproducibility, and business intelligence must work together.

Ultimately, the system shows how advanced SAS programming techniques can transform raw operational drone logs into a controlled, analysis-ready, fraud-aware platform suitable for production-level decision-making.


SAS INTERVIEW QUESTIONS

·  How does SAS handle missing numeric values in comparisons?

·  What is the difference between WHERE and IF statement?

·  What is RETAIN statement used for?


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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 DRONE FLIGHT 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


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Follow Us On : 


 
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

--->Follow our blog for more SAS-based analytics projects and industry data models.

---> Support Us By Following Our Blog..

To deepen your understanding of SAS analytics, please refer to our other data science and industry-focused projects listed below:



--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

About Us | Contact Privacy Policy


Comments

Popular posts from this blog

412.Can We Build And Clean A University Course Analytics & Fraud Detection System In Sas Using Only Macros While Intentionally Creating And Fixing Errors?

409.Can We Build a Reliable Emergency Services Analytics & Fraud Detection System in SAS While Identifying and Fixing Intentional Errors?

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