Hi, I wanted to find the entry and exit dates of stocks in quarterly data by a specific firm during some years. for example:
if a firm buys apple stock in quarter one and then in quarter 2. This is visible with dates in both quarters but if it sells it, it wont be in 3rd quarter. Now I want code which can show dates in which it enters and on which it exits.
Welcome to the communities!
I moved this to the Programming community, since it's got nothing to do with the administration of the SAS software itself.
Please supply usable example data (ideally in a DATA step with DATALINES), and the expected outcome.
Welcome to the communities!
I moved this to the Programming community, since it's got nothing to do with the administration of the SAS software itself.
Please supply usable example data (ideally in a DATA step with DATALINES), and the expected outcome.
hi, I am trying to fetch the dates of stocks entry and exit in each quarter (as its quarterly data). e.g. a firm buy some stocks and it shows data of each quarter where only buy stocks are present. Now I want to get the column of change in those stocks investment market value in each quarter and dates where they are first time bought and where they exit(they are no more in the list of stocks in a quarter). Plus a column "if stock is bought then 1 otherwise zero".When they are no longer in next quarter it shows they are sold. so a column "if it is sold then 1 otherwise zero" I am attaching the screenshot of example.
I realize you are new here, but we cannot write code based on data in a screen capture. We have to work from SAS data sets, not Excel files and not screen captures. To provide data, we need it to be provided as working SAS data step code (examples and instructions) and not in any other form. We don't need the entire data set, but enough so we can write a program and obtain the results you want.
I also don't understand your explanation. Please provide the desired output, and write the explanation so we can see examples of how you go from the input data to the desired output.
Please do not start new threads for the same subject. Keep your replies and posts with the requested details in here.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.