Tom, I can't thank you enough for your continued engagement. Below is the code that leads to the leads to the Data dataset mentioned above; in the code below the test2 dataset is the same as the Data dataset mentioned above. Are you saying that I should bring in ValuationDate and MaturityDate from the .csv file using an MMDDYY informat? Also, relating to your question on my other posting ("Not sure why this is not working"); this is best explained in the last data step below (data test3), which is a (cleaner) variation of the code I have in the other posting. I am trying to define arrays of different lengths depending on whether the InterestFrequency variable assumes a value of 2 or 12; InterestFrequency represents the frequency of the coupon payments on a bond, so if the bond pays interest semiannually (ie InterestFrequency=2) it will have different cashflows (represented by the array) from a bond that pays interest monthly (and hence, has a different array associated with it, whereby InterestFrequency=12). As you can see, my entire "data test3" datastep hinges on my being able to convert InterestFrequency, MaturityDate, and ValuationDate into numeric variables so that I can get the datastep to run. I hope this clarifies matters. data WORK.NCDebt; infile '/fmacdata/utility/fin/KBenchmarks/SAS Data/NCDebt_1.csv' dsd lrecl=40000 firstobs=3; informat ValuationDate yymmdd.; informat MaturityDate mmddyy10.; informat InterestFrequency 5.; informat AccruedDayCount $10.; format ValuationDate date9. MaturityDate date9.; input ValuationDate MaturityDate InterestFrequency AccruedDayCount $; run; proc transpose data=Ncdebt out=Ncdebt2; var ValuationDate MaturityDate InterestFrequency AccruedDayCount; run; data Ncdebt3; set Ncdebt2(rename=(_NAME_=Var1)); keep Var1 COL1; run; proc sql; select COL1 into: ValuationDate from Ncdebt3 where Var1='ValuationDate'; quit; proc sql; select COL1 into: MaturityDate from Ncdebt3 where Var1='MaturityDate'; quit; %let Result=%sysevalf("&MaturityDate"d-"&ValuationDate"d); %put &Result; proc transpose data=Ncdebt3 out=test; var var1 COL1; id var1; run; data test2; set test (firstobs=2); keep MaturityDate ValuationDate InterestFrequency; run; data Test3; set Test2; if InterestFrequency='2' then do; count1=(intck('semiyear',ValuationDate,MaturityDate)+1); %let arrelements=count1; array dt{&arrelements} dt1-dt&arrelements; end; else if InterestFrequency='12' then do; count1=(intck('month',ValuationDate,MaturityDate)+1); %let arrelements=count1; array date{&arrelements} date1-date&arrelements; end; run;
... View more