SHARE
TWEET

Untitled

a guest May 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. QUERY 1:
  2.        select eur2.*, (case when srm2.gflag5='Y' then -srm2.g5 else null end) as basis_eur, e.a_exposure as a_exposure_eur,
  3.        round(((trunc(eur2.ytw_date_eur)+0-trunc(dd.price_date)+1)/365.25), 2) as T_eur,
  4.        (eur2.coupon_eur*100)/eur2.price_eur as coupon_carry_eur,
  5.        dr.rate as financing_eur
  6.        from eur2
  7.        join pm_own.sec_risk_measures2 srm2 ON (eur2.ssm_id_eur = srm2.ssm_id)
  8.        join pm_own.preload_exposure_all e ON (srm2.ssm_id = e.ssm_id)
  9.        cross join dd
  10.        join pm_own.deposit_rates dr ON (eur2.currency_settlement_eur = dr.currency_code AND trunc(dr.asof_date) = trunc(dd.price_date) and dr.term_months=12 and  
  11.        (case when eur2.currency_settlement_eur = 'EUR' and dr.market = 'E' then 'VALID' when eur2.currency_settlement_eur <> 'EUR' and dr.market = 'L' then 'VALID' end) = 'VALID'
  12.       )
  13.        where a_exposure+b_exposure>0
  14.  
  15.  
  16. QUERY 2:
  17.        select eur2.*, (case when srm2.gflag5='Y' then -srm2.g5 else null end) as basis_eur, e.a_exposure as a_exposure_eur,
  18.        round(((trunc(eur2.ytw_date_eur)+0-trunc(dd.price_date)+1)/365.25), 2) as T_eur,
  19.        (eur2.coupon_eur*100)/eur2.price_eur as coupon_carry_eur,
  20.        dr.rate as financing_eur
  21.        from eur2, pm_own.sec_risk_measures2 srm2,pm_own.preload_exposure_all e, pm_own.deposit_rates dr, dd
  22.        where eur2.ssm_id_eur = srm2.ssm_id and srm2.ssm_id = e.ssm_id and a_exposure+b_exposure>0
  23.        and eur2.currency_settlement_eur = dr.currency_code and dr.term_months=12 and trunc(dr.asof_date) = trunc(dd.price_date)
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top