NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

3    
4    libname dc
4  ! "C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
4  ! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data";
NOTE: Libref DC was successfully assigned as follows: 
      Engine:        V9 
      Physical Name: 
      C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
      AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data
5    
6    
7    /*1. Change in 3-month t-bill rate*/
8    
9    PROC IMPORT OUT=intrate
10               DATAFILE=
10 ! "C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
10 ! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV"
11               DBMS=csv REPLACE;
12   RUN;

13    /**********************************************************************
14    *   PRODUCT:   SAS
15    *   VERSION:   9.4
16    *   CREATOR:   External File Interface
17    *   DATE:      19NOV24
18    *   DESC:      Generated SAS Datastep Code
19    *   TEMPLATE SOURCE:  (None Specified.)
20    ***********************************************************************/
21       data WORK.INTRATE    ;
22       %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
23       infile
23 ! 'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
23 ! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV' delimiter = ','
24   MISSOVER DSD lrecl=32767 firstobs=2 ;
25          informat Date mmddyy10. ;
26          informat TB3M $4. ;
27          informat TB10Y $4. ;
28          format Date mmddyy10. ;
29          format TB3M $4. ;
30          format TB10Y $4. ;
31       input
32                   Date
33                   TB3M  $
34                   TB10Y  $
35       ;
36       if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
37       run;

NOTE: The infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV' is:
      
      Filename=C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\
      Journal\JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV,
      RECFM=V,LRECL=32767,File Size (bytes)=178478,
      Last Modified=03Apr2023:13:41:57,
      Create Time=19Nov2024:09:43:30

NOTE: 8674 records were read from the infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV'.
      The minimum record length was 12.
      The maximum record length was 20.
NOTE: The data set WORK.INTRATE has 8674 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds
      

8674 rows created in WORK.INTRATE from 
C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\JAR\Cod
eAndData\00_DataCollection\dc_code\CoVaR\cv_data\InterestRates.CSV.
  
  
  
NOTE: WORK.INTRATE data set was successfully created.
NOTE: The data set WORK.INTRATE has 8674 observations and 3 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.19 seconds
      cpu time            0.06 seconds
      

38   
39   data intrate;
40   set intrate;
41   tb3m=tb3m*1;
42   tb10y=tb10y*1;
43   if tb3m~=. and tb10y~=.;
44   d_tb3m=dif(tb3m);
45   d_tb10y=dif(tb10y);
46   d_yieldcurve=TB10Y-TB3M;
47   y=year(date);
48   w=week(date);
49   run;

NOTE: Character values have been converted to numeric values at the places given by: 
      (Line):(Column).
      41:6    42:7    43:4    43:16   44:12   45:13   46:14   46:20   
NOTE: Numeric values have been converted to character values at the places given by: 
      (Line):(Column).
      41:10   42:12   
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=01/01/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=1
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=01/15/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=11
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=02/19/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=36
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=04/13/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=75
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=05/28/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=106
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=07/04/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=133
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=09/03/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=176
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=10/08/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=201
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=11/12/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=226
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=11/22/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=234
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=12/25/1990 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=257
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=01/01/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=262
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=01/21/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=276
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=02/18/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=296
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=03/29/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=325
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=05/27/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=366
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=07/04/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=394
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=09/02/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=436
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
Date=10/14/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=466
NOTE: Invalid numeric data, TB3M='ND' , at line 41 column 6.
NOTE: Invalid numeric data, TB10Y='ND' , at line 42 column 7.
WARNING: Limit set by ERRORS= option reached.  Further errors of this type will not be printed.
Date=11/11/1991 TB3M=. TB10Y=. d_tb3m=. d_tb10y=. d_yieldcurve=. y=. w=. _ERROR_=1 _N_=486
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      357 at 41:10   357 at 42:12   
NOTE: There were 8674 observations read from the data set WORK.INTRATE.
NOTE: The data set WORK.INTRATE has 8317 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

50   
51   
52   proc means data=intrate noprint;
53   var d_tb3m;
54   by y w;
55   output out= d_tb3m (drop= _TYPE_ _FREQ_ ) sum=d_tb3m;
56   run;

NOTE: There were 8317 observations read from the data set WORK.INTRATE.
NOTE: The data set WORK.D_TB3M has 1749 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
      

57   
58   /*2. Change in the slope of the yield curve (definition see Bushman and Williams 2015,
58 ! p550)*/
59   proc means data=intrate noprint;
60   var d_yieldcurve;
61   by y w;
62   output out= d_yieldcurve (drop= _TYPE_ _FREQ_ ) mean=d_yieldcurve;
63   run;

NOTE: There were 8317 observations read from the data set WORK.INTRATE.
NOTE: The data set WORK.D_YIELDCURVE has 1749 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

64   
65   /*3. LiquiditySpread*/
66   PROC IMPORT OUT=Repo3M
67               DATAFILE=
67 ! "C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
67 ! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV"
68               DBMS=csv REPLACE;
69   RUN;

70    /**********************************************************************
71    *   PRODUCT:   SAS
72    *   VERSION:   9.4
73    *   CREATOR:   External File Interface
74    *   DATE:      19NOV24
75    *   DESC:      Generated SAS Datastep Code
76    *   TEMPLATE SOURCE:  (None Specified.)
77    ***********************************************************************/
78       data WORK.REPO3M    ;
79       %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
80       infile
80 ! 'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
80 ! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV' delimiter = ',' MISSOVER
80 ! DSD
81   lrecl=32767 firstobs=2 ;
82          informat Date mmddyy10. ;
83          informat Repo3M best32. ;
84          format Date mmddyy10. ;
85          format Repo3M best12. ;
86       input
87                   Date
88                   Repo3M
89       ;
90       if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
91       run;

NOTE: The infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV' is:
      
      Filename=C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\
      Journal\JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV,
      RECFM=V,LRECL=32767,File Size (bytes)=131483,
      Last Modified=03Apr2023:15:57:39,
      Create Time=19Nov2024:09:43:31

NOTE: 8028 records were read from the infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV'.
      The minimum record length was 10.
      The maximum record length was 16.
NOTE: The data set WORK.REPO3M has 8028 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

8028 rows created in WORK.REPO3M from 
C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\JAR\Cod
eAndData\00_DataCollection\dc_code\CoVaR\cv_data\Repo3M.CSV.
  
  
  
NOTE: WORK.REPO3M data set was successfully created.
NOTE: The data set WORK.REPO3M has 8028 observations and 2 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds
      

92   
93   data tb3m;
94   set intrate;
95   keep date TB3M y w;
96   run;

NOTE: There were 8317 observations read from the data set WORK.INTRATE.
NOTE: The data set WORK.TB3M has 8317 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

97   
98   proc sort data=repo3m;by date;run;

NOTE: There were 8028 observations read from the data set WORK.REPO3M.
NOTE: The data set WORK.REPO3M has 8028 observations and 2 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

99   
100  data tb3mrepo3m;
101  merge tb3m (in=a) repo3m;
102  by date;
103  if a;
104  run;

NOTE: There were 8317 observations read from the data set WORK.TB3M.
NOTE: There were 8028 observations read from the data set WORK.REPO3M.
NOTE: The data set WORK.TB3MREPO3M has 8317 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

105  
106  data tb3mrepo3m;
107  set tb3mrepo3m;
108  liqspread=repo3m-tb3m;
109  if liqspread~=.;
110  run;

NOTE: Character values have been converted to numeric values at the places given by: 
      (Line):(Column).
      108:18   
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      442 at 108:17   
NOTE: There were 8317 observations read from the data set WORK.TB3MREPO3M.
NOTE: The data set WORK.TB3MREPO3M has 7875 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

111  
112  
113  proc means data=tb3mrepo3m noprint;
114  var liqspread;
115  by y w;
116  output out= liqspread (drop= _TYPE_ _FREQ_ ) mean=liqspread;
117  run;

NOTE: There were 7875 observations read from the data set WORK.TB3MREPO3M.
NOTE: The data set WORK.LIQSPREAD has 1676 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

118  
119  
120  /*4. Change in the credit spread */
121  
122  PROC IMPORT OUT=MoodyBAA
123              DATAFILE=
123! "C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
123! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV"
124              DBMS=csv REPLACE;
125  RUN;

126   /**********************************************************************
127   *   PRODUCT:   SAS
128   *   VERSION:   9.4
129   *   CREATOR:   External File Interface
130   *   DATE:      19NOV24
131   *   DESC:      Generated SAS Datastep Code
132   *   TEMPLATE SOURCE:  (None Specified.)
133   ***********************************************************************/
134      data WORK.MOODYBAA    ;
135      %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
136      infile
136! 'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
136! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV' delimiter = ',' MISSOVER
137   DSD lrecl=32767 firstobs=2 ;
138         informat DATE mmddyy10. ;
139         informat DBAA best32. ;
140         format DATE mmddyy10. ;
141         format DBAA best12. ;
142      input
143                  DATE
144                  DBAA
145      ;
146      if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
147      run;

NOTE: The infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV' is:
      
      Filename=C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\
      Journal\JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV,
      RECFM=V,LRECL=32767,File Size (bytes)=136449,
      Last Modified=03Apr2023:16:24:52,
      Create Time=19Nov2024:09:43:30

NOTE: 8675 records were read from the infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV'.
      The minimum record length was 9.
      The maximum record length was 16.
NOTE: The data set WORK.MOODYBAA has 8675 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

8675 rows created in WORK.MOODYBAA from 
C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\JAR\Cod
eAndData\00_DataCollection\dc_code\CoVaR\cv_data\MoodyBAA.CSV.
  
  
  
NOTE: WORK.MOODYBAA data set was successfully created.
NOTE: The data set WORK.MOODYBAA has 8675 observations and 2 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
      

148  
149  
150  data baa;
151  merge moodybaa (in=a) intrate;
152  by date;
153  if a;
154  run;

NOTE: There were 8675 observations read from the data set WORK.MOODYBAA.
NOTE: There were 8317 observations read from the data set WORK.INTRATE.
NOTE: The data set WORK.BAA has 8675 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

155  
156  data baa;
157  set baa;
158  creditspread=dbaa-tb10y;
159  d_creditspread=dif(creditspread);
160  if d_creditspread~=.;
161  keep y w d_creditspread;
162  run;

NOTE: Character values have been converted to numeric values at the places given by: 
      (Line):(Column).
      158:19   
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      412 at 158:18   
NOTE: There were 8675 observations read from the data set WORK.BAA.
NOTE: The data set WORK.BAA has 7884 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

163  
164  proc means data=baa noprint;
165  var d_creditspread;
166  by y w;
167  output out= d_creditspread (drop= _TYPE_ _FREQ_ ) sum=d_creditspread;
168  run;

NOTE: There were 7884 observations read from the data set WORK.BAA.
NOTE: The data set WORK.D_CREDITSPREAD has 1736 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

169  
170  
171  /*5. Market return*/
172  data mktret;
173  set dc.vwret;
174  run;

NOTE: There were 8315 observations read from the data set DC.VWRET.
NOTE: The data set WORK.MKTRET has 8315 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

175  
176  data mktret;
177  set mktret;
178  y=year(caldt);
179  w=week(caldt);
180  ret_log=log(1+vwretd);
181  run;

NOTE: There were 8315 observations read from the data set WORK.MKTRET.
NOTE: The data set WORK.MKTRET has 8315 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
      

182  
183  proc means data=mktret noprint;
184  var ret_log;
185  by y w;
186  output out= mktret_w (drop= _TYPE_ _FREQ_ ) sum=ret_log;
187  run;

NOTE: There were 8315 observations read from the data set WORK.MKTRET.
NOTE: The data set WORK.MKTRET_W has 1736 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

188  
189  data mktret_w;
190  set mktret_w;
191  retmkt=exp(ret_log)-1;
192  drop ret_log;
193  run;

NOTE: There were 1736 observations read from the data set WORK.MKTRET_W.
NOTE: The data set WORK.MKTRET_W has 1736 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

194  
195  /*6. Real estate market adjusted return*/
196  data reret;
197  set dc.realestatereturn;
198  run;

NOTE: There were 477210 observations read from the data set DC.REALESTATERETURN.
NOTE: The data set WORK.RERET has 477210 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.14 seconds
      cpu time            0.03 seconds
      

199  
200  data reret;
201  set reret;
202  y=year(DATE);
203  w=week(DATE);
204  prc=abs(prc);
205  mktcap=prc*shrout;
206  ret_log=log(1+ret);
207  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      10234 at 204:5    10234 at 205:11   10368 at 206:9    10368 at 206:14   
NOTE: There were 477210 observations read from the data set WORK.RERET.
NOTE: The data set WORK.RERET has 477210 observations and 13 variables.
NOTE: DATA statement used (Total process time):
      real time           0.13 seconds
      cpu time            0.06 seconds
      

208  
209  proc means data=reret noprint;
210  var ret_log;
211  by permno y w;
212  output out= reret_w (drop= _TYPE_ _FREQ_ ) sum=ret_log;
213  run;

NOTE: There were 477210 observations read from the data set WORK.RERET.
NOTE: The data set WORK.RERET_W has 99778 observations and 4 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.15 seconds
      cpu time            0.10 seconds
      

214  
215  data reret_w;
216  set reret_w;
217  ret=exp(ret_log)-1;
218  drop ret_log;
219  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      2144 at 217:5    2144 at 217:17   
NOTE: There were 99778 observations read from the data set WORK.RERET_W.
NOTE: The data set WORK.RERET_W has 99778 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

220  
221  
222  proc means data=reret noprint;
223  var mktcap;
224  by permno y w;
225  output out= mktcap_w (drop= _TYPE_ _FREQ_ ) mean=mktcap;
226  run;

NOTE: There were 477210 observations read from the data set WORK.RERET.
NOTE: The data set WORK.MKTCAP_W has 99778 observations and 4 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.15 seconds
      cpu time            0.09 seconds
      

227  
228  data retmktcap_w;
229  merge reret_w (in=a) mktcap_w;
230  by permno y w;
231  if a;
232  run;

NOTE: There were 99778 observations read from the data set WORK.RERET_W.
NOTE: There were 99778 observations read from the data set WORK.MKTCAP_W.
NOTE: The data set WORK.RETMKTCAP_W has 99778 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds
      

233  
234  proc sort data=retmktcap_w ; by y w;run;

NOTE: There were 99778 observations read from the data set WORK.RETMKTCAP_W.
NOTE: The data set WORK.RETMKTCAP_W has 99778 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.02 seconds
      cpu time            0.00 seconds
      

235  
236  proc means data=retmktcap_w noprint;
237  var mktcap;
238  by y w;
239  output out= totalmktcap (drop= _TYPE_ _FREQ_ ) sum=totalmktcap;
240  run;

NOTE: There were 99778 observations read from the data set WORK.RETMKTCAP_W.
NOTE: The data set WORK.TOTALMKTCAP has 1745 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

241  
242  data retmktcap_w;
243  merge retmktcap_w (in=a) totalmktcap;
244  by y w;
245  if a;
246  run;

NOTE: There were 99778 observations read from the data set WORK.RETMKTCAP_W.
NOTE: There were 1745 observations read from the data set WORK.TOTALMKTCAP.
NOTE: The data set WORK.RETMKTCAP_W has 99778 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

247  
248  data retmktcap_w;
249  set retmktcap_w;
250  ret_weighted=ret*mktcap/totalmktcap;
251  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      2144 at 250:17   
NOTE: There were 99778 observations read from the data set WORK.RETMKTCAP_W.
NOTE: The data set WORK.RETMKTCAP_W has 99778 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

252  
253  proc means data=retmktcap_w noprint;
254  var ret_weighted;
255  by y w;
256  output out= ret_resector_w (drop= _TYPE_ _FREQ_ ) sum=ret;
257  run;

NOTE: There were 99778 observations read from the data set WORK.RETMKTCAP_W.
NOTE: The data set WORK.RET_RESECTOR_W has 1745 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds
      

258  
259  
260  data ret_re_mktadj_w;
261  merge ret_resector_w (in=a) mktret_w;
262  by y w;
263  run;

NOTE: There were 1745 observations read from the data set WORK.RET_RESECTOR_W.
NOTE: There were 1736 observations read from the data set WORK.MKTRET_W.
NOTE: The data set WORK.RET_RE_MKTADJ_W has 1745 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

264  
265  data ret_re_mktadj_w;
266  set ret_re_mktadj_w;
267  ret_re_mktadj=ret-retmkt;
268  drop ret retmkt;
269  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      9 at 267:18   
NOTE: There were 1745 observations read from the data set WORK.RET_RE_MKTADJ_W.
NOTE: The data set WORK.RET_RE_MKTADJ_W has 1745 observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

270  
271  
272  /*7. VIX*/
273  PROC IMPORT OUT=VIX
274              DATAFILE=
274! "C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
274! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV"
275              DBMS=csv REPLACE;
276  RUN;

277   /**********************************************************************
278   *   PRODUCT:   SAS
279   *   VERSION:   9.4
280   *   CREATOR:   External File Interface
281   *   DATE:      19NOV24
282   *   DESC:      Generated SAS Datastep Code
283   *   TEMPLATE SOURCE:  (None Specified.)
284   ***********************************************************************/
285      data WORK.VIX    ;
286      %let _EFIERR_ = 0; /* set the ERROR detection macro variable */
287      infile
287! 'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\J
287! AR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV' delimiter = ',' MISSOVER DSD
288  lrecl=32767 firstobs=2 ;
289         informat DATE mmddyy10. ;
290         informat VIX best32. ;
291         format DATE mmddyy10. ;
292         format VIX best12. ;
293      input
294                  DATE
295                  VIX
296      ;
297      if _ERROR_ then call symputx('_EFIERR_',1);  /* set ERROR detection macro variable */
298      run;

NOTE: The infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV' is:
      
      Filename=C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\
      Journal\JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV,
      RECFM=V,LRECL=32767,File Size (bytes)=141062,
      Last Modified=03Apr2023:16:13:35,
      Create Time=19Nov2024:09:43:31

NOTE: 8380 records were read from the infile 
      'C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\
      JAR\CodeAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV'.
      The minimum record length was 11.
      The maximum record length was 16.
NOTE: The data set WORK.VIX has 8380 observations and 2 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

8380 rows created in WORK.VIX from 
C:\Users\yl2269\Dropbox\Yao_Backup\ChicagoBooth_DB\Research_Project\Bank_liquidity\Journal\JAR\Cod
eAndData\00_DataCollection\dc_code\CoVaR\cv_data\VIX.CSV.
  
  
  
NOTE: WORK.VIX data set was successfully created.
NOTE: The data set WORK.VIX has 8380 observations and 2 variables.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds
      

299  
300  data vix;
301  set vix;
302  y=year(DATE);
303  w=week(DATE);
304  run;

NOTE: There were 8380 observations read from the data set WORK.VIX.
NOTE: The data set WORK.VIX has 8380 observations and 4 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

305  
306  proc means data=vix noprint;
307  var vix;
308  by y w;
309  output out= vix (drop= _TYPE_ _FREQ_ ) mean=vix;
310  run;

NOTE: There were 8380 observations read from the data set WORK.VIX.
NOTE: The data set WORK.VIX has 1749 observations and 3 variables.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

311  
312  /*Combine all seven regressors*/
313  
314  data covarregressors;
315  merge d_tb3m (in=a) d_yieldcurve liqspread d_creditspread mktret_w ret_re_mktadj_w vix;
316  by y w;
317  if a;
318  run;

NOTE: There were 1749 observations read from the data set WORK.D_TB3M.
NOTE: There were 1749 observations read from the data set WORK.D_YIELDCURVE.
NOTE: There were 1676 observations read from the data set WORK.LIQSPREAD.
NOTE: There were 1736 observations read from the data set WORK.D_CREDITSPREAD.
NOTE: There were 1736 observations read from the data set WORK.MKTRET_W.
NOTE: There were 1745 observations read from the data set WORK.RET_RE_MKTADJ_W.
NOTE: There were 1749 observations read from the data set WORK.VIX.
NOTE: The data set WORK.COVARREGRESSORS has 1749 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
      

319  
320  data covarregressors;
321  set covarregressors;
322  if y<=2022;
323  run;

NOTE: There were 1749 observations read from the data set WORK.COVARREGRESSORS.
NOTE: The data set WORK.COVARREGRESSORS has 1736 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

324  
325  
326  data dc.covarregressors;
327  set covarregressors;
328  run;

NOTE: There were 1736 observations read from the data set WORK.COVARREGRESSORS.
NOTE: The data set DC.COVARREGRESSORS has 1736 observations and 9 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds
      

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           36.41 seconds
      cpu time            0.96 seconds
      
