As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Excel functions in SAS

From sasCommunity
Jump to: navigation, search

A little hidden gem in the documentation for PROC FCMP:

PROC FCMP and Microsoft Excel

Many Microsoft Excel functions, not typically available in SAS, are implemented in PROC FCMP. You can find these functions in the sashelp.slkwxl data set.


Let's explore what this has to offer:

PROC FCMP INLIB=sashelp.slkwxl LISTALL; RUN;


Listing of Program Code

Function varp_slk ( data )

Function devsq_slk ( data )

Function avedev_slk ( data )

Function product_slk ( nums )

Function odd_slk ( x )

Function multinomial_slk ( nums )

Function floor_slk ( n, sg )

Function factdouble_slk ( x )

Function even_slk ( x )

Function yieldmat_slk ( settlement, maturity, issue, rate, pr, basis )

Function yielddisc_slk ( settlement, maturity, pr, redemp, basis )

Function yield_slk ( settlement, maturity, rate, pr, redemp, freq, basis )

Function tbillyield_slk ( settlement, maturity, par )

Function tbillprice_slk ( settlement, maturity, discount )

Function tbilleq_slk ( settlement, maturity, discount )

Function received_slk ( settlement, maturity, investment, discount, basis )

Function pricemat_slk ( settlement, maturity, issue, rate, yld, basis )

Function pricedisc_slk ( settlement, maturity, discount, redemp, basis )

Function price_slk ( settlement, maturity, rate, yield, redemp, freq, basis )

Function oddlyield_slk ( settlement, maturity, linterest, rate, pr, redemp, freq, basis )

Function oddlprice_slk ( settlement, maturity, linterest, rate, yield, redemp, freq, basis )

Function oddfyield_slk ( settlement, maturity, issue, fcoupon, rate, pr, redemp, freq, basis )

Function oddfprice_slk ( settlement, maturity, issue, fcoupon, rate, yield, redemp, freq, basis )

Function mduration_slk ( settlement, maturity, coupon, yld, freq, basis )

Function effect_slk ( nominal_rate, npery )

Function duration_slk ( settlement, maturity, coupon, yld, freq, basis )

Function dollarfr_slk ( ddollar, frac )

Function dollarde_slk ( fdollar, frac )

Function disc_slk ( settlement, maturity, pr, redemp, basis )

Function db_slk ( cost, salvage, life, period, month )

Function datdif4_slk ( start, end )

Function couppcd_slk ( settlement, maturity, freq, basis )

Function coupnum_slk ( settlement, maturity, freq, basis )

Function coupncd_slk ( settlement, maturity, freq, basis )

Function coupdaysnc_slk ( settlement, maturity, freq, basis )

Function coupdays_slk ( settlement, maturity, freq, basis )

Function coupdaybs_slk ( settlement, maturity, freq, basis )

Function amorlinc_slk ( cost, datep, fperiod, salvage, period, rate, basis )

Function amordegrc_slk ( cost, datep, fperiod, salvage, period, rate, basis )

Function accrintm_slk ( issue, maturity, rate, par, basis )

Function accrint_slk ( issue, finterest, settlement, rate, par, freq, basis )


Use these functions:

OPTIONS CMPLIB = sashelp.slkwxl;
DATA _NULL_;
  num     = 4.2;
  odd_num = ODD_SLK(num);
  PUT 'Odd number nearest to' num ' is ' odd_num;
RUN;