225.ANALYZING LEGENDARY INDIAN COURTROOM SCENES USING PROC DATASTEP | PROC CONTENTS | PROC MEANS | PROC UNIVARIATE | PROC FREQ | PROC SQL | PROC REPORT | PROC SUMMARY | PROC EXPORT IN SAS

ANALYZING LEGENDARY INDIAN COURTROOM SCENES USING PROC DATASTEP | PROC CONTENTS | PROC MEANS | PROC UNIVARIATE | PROC FREQ | PROC SQL | PROC REPORT | PROC SUMMARY | PROC EXPORT IN SAS

/*Dataset of “ultimate” courtroom sequences in Indian cinema.*/

1.Global SAS environment options

options nocenter             

        fmtsearch=(work)     

        pagesize=60 linesize=120;


2.Creating the data set (DATA step + functions)

data court_scenes_in_films;

   infile datalines dsd truncover;

   length filmname $40 lang $12 verdict $15 lead_lawyer director $30 famous_quote $120;

   input filmid filmname :$40. lang :$12. rel_year scene_min verdict :$15.

         lead_lawyer :$30. director :$30. drama_score famous_quote :$120. boxoffice_cr;


   /*--- DERIVE decade label with INTNX + PUT ---*/

   dec_start = intnx('year', mdy(1,1,rel_year), 0, 'B'); /* first day of rel_year */

   decade    = put(year(dec_start), 4.) || "s";          /* e.g. '1990s' */


   /*--- Standardise verdict text */

   length verdict_up $15;

   verdict_up = upcase(verdict);


   /*--- Flag for “acquittal” vs “conviction” using COMPRESS + COMPBL ---*/

   if compress(verdict_up) in ("NOTGUILTY","ACQUITTAL") then outcome=0;

   else outcome=1;


   /*--- Make a brief slug for URLs with CATX ---*/

   slug = lowcase(catx('-', compress(filmname, , 'kad'), rel_year));


   label scene_min   = "Minutes of Courtroom Action"

         drama_score = "Subjective Drama Intensity 0–100"

         dec_start   = "Calendar start of release year"

         outcome     = "1=Conviction 0=Acquittal";


   format dec_start date9. boxoffice_cr 8.1;

datalines;

101,"Pink","Hindi",2016,29.4,"Not Guilty","Amitabh Bachchan","Aniruddha Roy Chowdhury",95,"No means no!",108.7

102,"Damini","Hindi",1993,24.7,"Guilty","Sunny Deol","Rajkumar Santoshi",97,"Tareekh pe tareekh!",39.8

103,"Court","Marathi",2014,38.2,"Adjourned","Vivek Gomber","Chaitanya Tamhane",92,"Justice delayed is justice denied",1.8

104,"Vakeel Saab","Telugu",2021,25.5,"Not Guilty","Pawan Kalyan","Venu Sriram",88,"Naaku real stamina undhi!",137.3

105,"Shahid","Hindi",2013,17.0,"Guilty","Rajkummar Rao","Hansal Mehta",90,"Terror has no religion",5.6

106,"Meri Jung","Hindi",1985,30.2,"Guilty","Anil Kapoor","Subhash Ghai",93,"Kanoon andha nahi hai!",9.7

107,"Veer-Zaara","Hindi",2004,15.3,"Not Guilty","Rani Mukerji","Yash Chopra",80,"Love knows no borders",97.5

108,"Anniyan","Tamil",2005,20.8,"Guilty","Vikram","S. Shankar",89,"Rules are for everyone!",100.1

109,"Oh My Kadavule","Tamil",2020,10.5,"Adjourned","Ashok Selvan","Ashwath Marimuthu",70,"Fate is playful",52.4

110,"Nerkonda Paarvai","Tamil",2019,28.7,"Not Guilty","Ajith Kumar","H. Vinoth",91,"No means no—Tamil edition",180.7

111,"Rustom","Hindi",2016,23.0,"Not Guilty","Akshay Kumar","Tinu Suresh Desai",85,"I confess my love, not guilt",216.3

112,"Jolly LLB","Hindi",2013,19.4,"Guilty","Arshad Warsi","Subhash Kapoor",87,"Jolly never quits",32.3

113,"Jolly LLB 2","Hindi",2017,22.8,"Guilty","Akshay Kumar","Subhash Kapoor",86,"Truth will out",195.0

114,"OMG","Hindi",2012,14.6,"Guilty","Paresh Rawal","Umesh Shukla",78,"God is in the details",83.2

115,"Raazi","Hindi",2018,8.4,"Adjourned","Alia Bhatt","Meghna Gulzar",82,"Watan ke aage kuch nahi",197.4

116,"Section 375","Hindi",2019,27.3,"Guilty","Akshaye Khanna","Ajay Bahl",94,"Law is a tool!",20.4

117,"Chekka Chivantha Vaanam","Tamil",2018,6.2,"Adjourned","Arvind Swami","Mani Ratnam",76,"Family first?",92.1

118,"Talvar","Hindi",2015,12.7,"Guilty","Irrfan Khan","Meghna Gulzar",90,"Truth has many versions",30.0

119,"Visaranai","Tamil",2015,16.5,"Guilty","Dinesh","Vetrimaaran",96,"Systemic rot exposed",6.0

120,"Kaappaan","Tamil",2019,9.9,"Acquittal","Suriya","K. V. Anand",75,"Nation over self",150.6

121,"Drishyam 2","Malayalam",2021,18.2,"Acquittal","Mohanlal","Jeethu Joseph",88,"Family is everything",58.0

122,"Manichitrathazhu","Malayalam",1993,11.0,"Adjourned","Suresh Gopi","Fazil",84,"Split personalities at play",23.5

123,"Nyaay: The Justice","Hindi",2021,21.4,"Guilty","Zuber K. Khan","Dilip Gulati",50,"Justice or vendetta?",0.9

124,"Thalaivi","Tamil",2021,13.6,"Acquittal","Kangana Ranaut","A. L. Vijay",79,"History will remember",30.7

125,"Singham","Hindi",2011,7.3,"Guilty","Ajay Devgn","Rohit Shetty",74,"Aata majhi satakli!",155.0

;

run;

proc print;run;

Output:

Obs filmname lang verdict lead_lawyer director famous_quote filmid rel_year scene_min drama_score boxoffice_cr dec_start decade verdict_up outcome slug
1 Pink Hindi Not Guilty Amitabh Bachchan Aniruddha Roy Chowdhury No means no! 101 2016 29.4 95 108.7 01JAN2016 2016s NOT GUILTY 0 pink-2016
2 Damini Hindi Guilty Sunny Deol Rajkumar Santoshi Tareekh pe tareekh! 102 1993 24.7 97 39.8 01JAN1993 1993s GUILTY 1 damini-1993
3 Court Marathi Adjourned Vivek Gomber Chaitanya Tamhane Justice delayed is justice denied 103 2014 38.2 92 1.8 01JAN2014 2014s ADJOURNED 1 court-2014
4 Vakeel Saab Telugu Not Guilty Pawan Kalyan Venu Sriram Naaku real stamina undhi! 104 2021 25.5 88 137.3 01JAN2021 2021s NOT GUILTY 0 vakeelsaab-2021
5 Shahid Hindi Guilty Rajkummar Rao Hansal Mehta Terror has no religion 105 2013 17.0 90 5.6 01JAN2013 2013s GUILTY 1 shahid-2013
6 Meri Jung Hindi Guilty Anil Kapoor Subhash Ghai Kanoon andha nahi hai! 106 1985 30.2 93 9.7 01JAN1985 1985s GUILTY 1 merijung-1985
7 Veer-Zaara Hindi Not Guilty Rani Mukerji Yash Chopra Love knows no borders 107 2004 15.3 80 97.5 01JAN2004 2004s NOT GUILTY 0 veerzaara-2004
8 Anniyan Tamil Guilty Vikram S. Shankar Rules are for everyone! 108 2005 20.8 89 100.1 01JAN2005 2005s GUILTY 1 anniyan-2005
9 Oh My Kadavule Tamil Adjourned Ashok Selvan Ashwath Marimuthu Fate is playful 109 2020 10.5 70 52.4 01JAN2020 2020s ADJOURNED 1 ohmykadavule-2020
10 Nerkonda Paarvai Tamil Not Guilty Ajith Kumar H. Vinoth No means no—Tamil edition 110 2019 28.7 91 180.7 01JAN2019 2019s NOT GUILTY 0 nerkondapaarvai-2019
11 Rustom Hindi Not Guilty Akshay Kumar Tinu Suresh Desai I confess my love, not guilt 111 2016 23.0 85 216.3 01JAN2016 2016s NOT GUILTY 0 rustom-2016
12 Jolly LLB Hindi Guilty Arshad Warsi Subhash Kapoor Jolly never quits 112 2013 19.4 87 32.3 01JAN2013 2013s GUILTY 1 jollyllb-2013
13 Jolly LLB 2 Hindi Guilty Akshay Kumar Subhash Kapoor Truth will out 113 2017 22.8 86 195.0 01JAN2017 2017s GUILTY 1 jollyllb2-2017
14 OMG Hindi Guilty Paresh Rawal Umesh Shukla God is in the details 114 2012 14.6 78 83.2 01JAN2012 2012s GUILTY 1 omg-2012
15 Raazi Hindi Adjourned Alia Bhatt Meghna Gulzar Watan ke aage kuch nahi 115 2018 8.4 82 197.4 01JAN2018 2018s ADJOURNED 1 raazi-2018
16 Section 375 Hindi Guilty Akshaye Khanna Ajay Bahl Law is a tool! 116 2019 27.3 94 20.4 01JAN2019 2019s GUILTY 1 section375-2019
17 Chekka Chivantha Vaanam Tamil Adjourned Arvind Swami Mani Ratnam Family first? 117 2018 6.2 76 92.1 01JAN2018 2018s ADJOURNED 1 chekkachivanthavaanam-2018
18 Talvar Hindi Guilty Irrfan Khan Meghna Gulzar Truth has many versions 118 2015 12.7 90 30.0 01JAN2015 2015s GUILTY 1 talvar-2015
19 Visaranai Tamil Guilty Dinesh Vetrimaaran Systemic rot exposed 119 2015 16.5 96 6.0 01JAN2015 2015s GUILTY 1 visaranai-2015
20 Kaappaan Tamil Acquittal Suriya K. V. Anand Nation over self 120 2019 9.9 75 150.6 01JAN2019 2019s ACQUITTAL 0 kaappaan-2019
21 Drishyam 2 Malayalam Acquittal Mohanlal Jeethu Joseph Family is everything 121 2021 18.2 88 58.0 01JAN2021 2021s ACQUITTAL 0 drishyam2-2021
22 Manichitrathazhu Malayalam Adjourned Suresh Gopi Fazil Split personalities at play 122 1993 11.0 84 23.5 01JAN1993 1993s ADJOURNED 1 manichitrathazhu-1993
23 Nyaay: The Justice Hindi Guilty Zuber K. Khan Dilip Gulati Justice or vendetta? 123 2021 21.4 50 0.9 01JAN2021 2021s GUILTY 1 nyaaythejustice-2021
24 Thalaivi Tamil Acquittal Kangana Ranaut A. L. Vijay History will remember 124 2021 13.6 79 30.7 01JAN2021 2021s ACQUITTAL 0 thalaivi-2021
25 Singham Hindi Guilty Ajay Devgn Rohit Shetty Aata majhi satakli! 125 2011 7.3 74 155.0 01JAN2011 2011s GUILTY 1 singham-2011

3.Quick structural check – PROC CONTENTS

proc contents data=court_scenes_in_films position;

   title "Structure of Court Scene Dataset";

run;

Output:

Structure of Court Scene Dataset

The CONTENTS Procedure

Data Set Name WORK.COURT_SCENES_IN_FILMS Observations 25
Member Type DATA Variables 16
Engine V9 Indexes 0
Created 14/09/2015 00:20:40 Observation Length 528
Last Modified 14/09/2015 00:20:40 Deleted Observations 0
Protection   Compressed NO
Data Set Type   Sorted NO
Label      
Data Representation WINDOWS_64    
Encoding wlatin1 Western (Windows)    

Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 124
Obs in First Data Page 25
Number of Data Set Repairs 0
ExtendObsCounter YES
Filename C:\Users\Lenovo\AppData\Local\Temp\SAS Temporary Files\_TD13972_DESKTOP-QFAA4KV_\court_scenes_in_films.sas7bdat
Release Created 9.0401M2
Host Created X64_8HOME

Alphabetic List of Variables and Attributes
# Variable Type Len Format Label
11 boxoffice_cr Num 8 8.1  
12 dec_start Num 8 DATE9. Calendar start of release year
13 decade Char 5    
5 director Char 30    
10 drama_score Num 8   Subjective Drama Intensity 0–100
6 famous_quote Char 120    
7 filmid Num 8    
1 filmname Char 40    
2 lang Char 12    
4 lead_lawyer Char 30    
15 outcome Num 8   1=Conviction 0=Acquittal
8 rel_year Num 8    
9 scene_min Num 8   Minutes of Courtroom Action
16 slug Char 200    
3 verdict Char 15    
14 verdict_up Char 15    

Variables in Creation Order
# Variable Type Len Format Label
1 filmname Char 40    
2 lang Char 12    
3 verdict Char 15    
4 lead_lawyer Char 30    
5 director Char 30    
6 famous_quote Char 120    
7 filmid Num 8    
8 rel_year Num 8    
9 scene_min Num 8   Minutes of Courtroom Action
10 drama_score Num 8   Subjective Drama Intensity 0–100
11 boxoffice_cr Num 8 8.1  
12 dec_start Num 8 DATE9. Calendar start of release year
13 decade Char 5    
14 verdict_up Char 15    
15 outcome Num 8   1=Conviction 0=Acquittal
16 slug Char 200    

4.Descriptive stats – PROC MEANS |PROC UNIVARIATE |PROC FREQ

proc means data=court_scenes_in_films n min q1 median mean q3 max maxdec=1;

   var scene_min drama_score boxoffice_cr;

   class decade;

   title "Minutes, Drama Scores, and Box Office by Decade";

run;

Output:

Minutes, Drama Scores, and Box Office by Decade

The MEANS Procedure

decade N Obs Variable Label N Minimum Lower Quartile Median Mean Upper Quartile Maximum
1985s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
30.2
93.0
9.7
30.2
93.0
9.7
30.2
93.0
9.7
30.2
93.0
9.7
30.2
93.0
9.7
30.2
93.0
9.7
1993s 2
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
2
2
2
11.0
84.0
23.5
11.0
84.0
23.5
17.9
90.5
31.7
17.9
90.5
31.7
24.7
97.0
39.8
24.7
97.0
39.8
2004s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
15.3
80.0
97.5
15.3
80.0
97.5
15.3
80.0
97.5
15.3
80.0
97.5
15.3
80.0
97.5
15.3
80.0
97.5
2005s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
20.8
89.0
100.1
20.8
89.0
100.1
20.8
89.0
100.1
20.8
89.0
100.1
20.8
89.0
100.1
20.8
89.0
100.1
2011s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
7.3
74.0
155.0
7.3
74.0
155.0
7.3
74.0
155.0
7.3
74.0
155.0
7.3
74.0
155.0
7.3
74.0
155.0
2012s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
14.6
78.0
83.2
14.6
78.0
83.2
14.6
78.0
83.2
14.6
78.0
83.2
14.6
78.0
83.2
14.6
78.0
83.2
2013s 2
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
2
2
2
17.0
87.0
5.6
17.0
87.0
5.6
18.2
88.5
19.0
18.2
88.5
19.0
19.4
90.0
32.3
19.4
90.0
32.3
2014s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
38.2
92.0
1.8
38.2
92.0
1.8
38.2
92.0
1.8
38.2
92.0
1.8
38.2
92.0
1.8
38.2
92.0
1.8
2015s 2
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
2
2
2
12.7
90.0
6.0
12.7
90.0
6.0
14.6
93.0
18.0
14.6
93.0
18.0
16.5
96.0
30.0
16.5
96.0
30.0
2016s 2
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
2
2
2
23.0
85.0
108.7
23.0
85.0
108.7
26.2
90.0
162.5
26.2
90.0
162.5
29.4
95.0
216.3
29.4
95.0
216.3
2017s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
22.8
86.0
195.0
22.8
86.0
195.0
22.8
86.0
195.0
22.8
86.0
195.0
22.8
86.0
195.0
22.8
86.0
195.0
2018s 2
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
2
2
2
6.2
76.0
92.1
6.2
76.0
92.1
7.3
79.0
144.8
7.3
79.0
144.8
8.4
82.0
197.4
8.4
82.0
197.4
2019s 3
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
3
3
3
9.9
75.0
20.4
9.9
75.0
20.4
27.3
91.0
150.6
22.0
86.7
117.2
28.7
94.0
180.7
28.7
94.0
180.7
2020s 1
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
1
1
1
10.5
70.0
52.4
10.5
70.0
52.4
10.5
70.0
52.4
10.5
70.0
52.4
10.5
70.0
52.4
10.5
70.0
52.4
2021s 4
scene_min
drama_score
boxoffice_cr
Minutes of Courtroom Action
Subjective Drama Intensity 0–100
 
4
4
4
13.6
50.0
0.9
15.9
64.5
15.8
19.8
83.5
44.4
19.7
76.3
56.7
23.5
88.0
97.7
25.5
88.0
137.3

proc univariate data=court_scenes_in_films noprint;

   var drama_score;

   histogram / midpoints=60 to 100 by 5;

   inset mean std / position=ne;

   title1 "Distribution of Drama Intensity Scores";

run;

Output:

WARNING: The MIDPOINTS= list was extended to accommodate the data.
NOTE: PROCEDURE UNIVARIATE used (Total process time):
      real time           3.40 seconds
      cpu time            0.67 seconds

proc freq data=court_scenes_in_films order=freq;

   tables verdict_up*lang / chisq norow nocol nopercent;

   title1 "Verdict by Language (Chi‑square)";

run;

Output:

Verdict by Language (Chi-square)

The FREQ Procedure

Frequency
Table of verdict_up by lang
verdict_up lang
Hindi Tamil Malayalam Marathi Telugu Total
GUILTY
10
2
0
0
0
12
ADJOURNED
1
2
1
1
0
5
NOT GUILTY
3
1
0
0
1
5
ACQUITTAL
0
2
1
0
0
3
Total
14
7
2
1
1
25


Statistics for Table of verdict_up by lang

Statistic DF Value Prob
Chi-Square 12 19.6429 0.0742
Likelihood Ratio Chi-Square 12 19.5778 0.0755
Mantel-Haenszel Chi-Square 1 4.2098 0.0402
Phi Coefficient   0.8864  
Contingency Coefficient   0.6633  
Cramer's V   0.5118  
WARNING: 95% of the cells have expected counts less
than 5. Chi-Square may not be a valid test.


Sample Size = 25

5.PROC SQL: Top‑N queries and derived views

proc sql feedback outobs=5;

   /* Top 5 longest courtroom segments */

   create table top5_length as

   select filmname, scene_min format=8.2, rel_year

   from   court_scenes_in_films

   order  by scene_min desc;

quit;

proc print;run;

Output:

Obs filmname scene_min rel_year
1 Court 38.20 2014
2 Meri Jung 30.20 1985
3 Pink 29.40 2016
4 Nerkonda Paarvai 28.70 2019
5 Section 375 27.30 2019

proc sql; 

/* Average drama score by verdict */

   select verdict_up,

          mean(drama_score) as avg_drama label="Avg Drama Score" format=8.1

   from   court_scenes_in_films

   group  by verdict_up

   order  by avg_drama desc;

quit;

Output:

verdict_up Avg Drama Score
NOT GUILTY 87.8
GUILTY 85.3
ADJOURNED 80.8
ACQUITTAL 80.7

6.Reusable Macro – Summarise by any grouping

%macro court_summary(group=);

   %let grp = %upcase(&group);       


   %put NOTE: Running COURT_SUMMARY grouped by &grp;


   proc means data=court_scenes_in_films n mean median min max maxdec=1;

      class &group;

      var scene_min drama_score boxoffice_cr;

      title2 "Numeric Summary by &grp";

   run;


   proc freq data=court_scenes_in_films;

      tables &group * verdict_up / nopercent norow nocol;

      title2 "Verdict Crosstab by &grp";

   run;

%mend;


%court_summary(group=lang)

Output:

Verdict Crosstab by LANG

The FREQ Procedure

Frequency
Table of lang by verdict_up
lang verdict_up
ACQUITTAL ADJOURNED GUILTY NOT GUILTY Total
Hindi
0
1
10
3
14
Malayalam
1
1
0
0
2
Marathi
0
1
0
0
1
Tamil
2
2
2
1
7
Telugu
0
0
0
1
1
Total
3
5
12
5
25

%court_summary(group=director)

Output:

Verdict Crosstab by DIRECTOR

The FREQ Procedure

Frequency
Table of director by verdict_up
director verdict_up
ACQUITTAL ADJOURNED GUILTY NOT GUILTY Total
A. L. Vijay
1
0
0
0
1
Ajay Bahl
0
0
1
0
1
Aniruddha Roy Chowdhury
0
0
0
1
1
Ashwath Marimuthu
0
1
0
0
1
Chaitanya Tamhane
0
1
0
0
1
Dilip Gulati
0
0
1
0
1
Fazil
0
1
0
0
1
H. Vinoth
0
0
0
1
1
Hansal Mehta
0
0
1
0
1
Jeethu Joseph
1
0
0
0
1
K. V. Anand
1
0
0
0
1
Mani Ratnam
0
1
0
0
1
Meghna Gulzar
0
1
1
0
2
Rajkumar Santoshi
0
0
1
0
1
Rohit Shetty
0
0
1
0
1
S. Shankar
0
0
1
0
1
Subhash Ghai
0
0
1
0
1
Subhash Kapoor
0
0
2
0
2
Tinu Suresh Desai
0
0
0
1
1
Umesh Shukla
0
0
1
0
1
Venu Sriram
0
0
0
1
1
Vetrimaaran
0
0
1
0
1
Yash Chopra
0
0
0
1
1
Total
3
5
12
5
25

7.PROC REPORT for publication‑ready table

proc summary data=court_scenes_in_films nway;

   class decade verdict_up;

   var scene_min drama_score;

   output out=summary_out(drop=_type_ rename=(_freq_=cnt))

      mean(scene_min)=mean_scene

      mean(drama_score)=mean_drama;

run;


proc report data=summary_out nowd;

   column decade verdict_up cnt mean_scene mean_drama;


   define decade / group;

   define verdict_up / group;

   define cnt / 'Count';

   define mean_scene / 'Avg Minutes';

   define mean_drama / 'Avg Drama';


   compute after;

      line @1 "Summary created on %sysfunc(date(), worddate.)";

   endcomp;


   title "Pre-Summarized Courtroom Report";

run;

Output:

Pre-Summarized Courtroom Report

decade verdict_up Count Avg Minutes Avg Drama
1985s GUILTY 1 30.2 93
1993s ADJOURNED 1 11 84
  GUILTY 1 24.7 97
2004s NOT GUILTY 1 15.3 80
2005s GUILTY 1 20.8 89
2011s GUILTY 1 7.3 74
2012s GUILTY 1 14.6 78
2013s GUILTY 2 18.2 88.5
2014s ADJOURNED 1 38.2 92
2015s GUILTY 2 14.6 93
2016s NOT GUILTY 2 26.2 90
2017s GUILTY 1 22.8 86
2018s ADJOURNED 2 7.3 79
2019s ACQUITTAL 1 9.9 75
  GUILTY 1 27.3 94
  NOT GUILTY 1 28.7 91
2020s ADJOURNED 1 10.5 70
2021s ACQUITTAL 2 15.9 83.5
  GUILTY 1 21.4 50
  NOT GUILTY 1 25.5 88
Summary created on September 14, 2015

8.PROC TABULATE for multidimensional stats

proc tabulate data=court_scenes_in_films;

   class lang verdict_up;

   var drama_score boxoffice_cr;

   table lang,

         verdict_up*(drama_score*mean boxoffice_cr*mean);

   title "Mean Drama & Box‑Office by Language x Verdict Matrix";

run;

Output:

Mean Drama & Box-Office by Language x Verdict Matrix

  verdict_up
ACQUITTAL ADJOURNED GUILTY NOT GUILTY
Subjective Drama
Intensity 0–100
boxoffice_cr Subjective Drama
Intensity 0–100
boxoffice_cr Subjective Drama
Intensity 0–100
boxoffice_cr Subjective Drama
Intensity 0–100
boxoffice_cr
Mean Mean Mean Mean Mean Mean Mean Mean
lang . . 82.00 197.40 83.90 57.19 86.67 140.83
Hindi
Malayalam 88.00 58.00 84.00 23.50 . . . .
Marathi . . 92.00 1.80 . . . .
Tamil 77.00 90.65 73.00 72.25 92.50 53.05 91.00 180.70
Telugu . . . . . . 88.00 137.30

9.Exporting to CSV – PROC EXPORT

proc export data=court_scenes_in_films

            outfile="court_scenes.csv"

            dbms=csv replace;

   putnames=yes;

run;

Log:

NOTE: The file 'court_scenes.csv' is:
      Filename=C:\sas folder\SASFoundation\9.4\court_scenes.csv,
      RECFM=V,LRECL=32767,File Size (bytes)=0,
      Last Modified=29 June 2025 17:32:11,
      Create Time=29 June 2025 17:32:11

NOTE: 26 records were written to the file 'court_scenes.csv'.
      The minimum record length was 120.
      The maximum record length was 154.
NOTE: There were 25 observations read from the data set WORK.COURT_SCENES_IN_FILMS.
NOTE: DATA statement used (Total process time):
      real time           0.28 seconds
      cpu time            0.06 seconds


25 records created in court_scenes.csv from COURT_SCENES_IN_FILMS.


NOTE: "court_scenes.csv" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           2.90 seconds
      cpu time            0.40 seconds



To Visit My Previous Sas Project 11-20 Questions:Click Here
To Visit My Previous %Let %Put %Eval In Sas:Click Here
To Visit My Previous Creating Assessing Cleaning Manipulation In Sas:Click Here
To Visit My Previous Proc Contents In Sas:Click Here






--->PLEASE FOLLOW OUR BLOG FOR MORE INFORMATION.
--->PLEASE DO COMMENTS AND SHARE OUR BLOG.


PLEASE FOLLOW OUR TELEGRAM CHANNEL CLICK HERE
PLEASE FOLLOW OUR FACEBOOK PAGE  CLICK HERE
PLEASE FOLLOW OUR INSTAGRAM PAGE CLICK HERE




 


Comments