BookmarkSubscribeRSS Feed
Xinhui
Obsidian | Level 7

Hello

    Plese see attachments, we have several option contracts in our excel doucument, how can I do to use SAS to build a new form from excel, which contract is 

datadate          expriation

11/01/2013      11/08/2013

11/08/2013      11/16/2013

11/15/2013      11/22/2013

11/22/2013      11/29/2013

 

4 REPLIES 4
Kurt_Bremser
Super User

SAS works with SAS datasets. Please post your example dataset as a data step using the macro from https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat...

Excel files do not convey structural information about SAS datasets, and they can carry malware, so they are blocked on many corporate firewalls for security reasons.

Xinhui
Obsidian | Level 7

Here is our sas bdat

Xinhui
Obsidian | Level 7

I want to select the contract weely which begin at 11/01/2013,  such as begin at (varible name datadate) 11/01/2013, expriate at 11/08/2013, and then datadate=11/08/2013, expriation date is 11/16/2013, since 11/16/2013 is holiday, market not opened at that day, so next contract is from 11/15/2013 to 11/22/2013. Finaly, we pick up all the contrcat which  

datadate          expriation

11/01/2013      11/08/2013

11/08/2013      11/16/2013

11/15/2013      11/22/2013

11/22/2013      11/29/2013

 I think we can use lag function to do that, but I don't know how to coding it.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 784 views
  • 0 likes
  • 2 in conversation