10-10-2018
MikeFranz
Quartz | Level 8
Member since
10-13-2016
- 47 Posts
- 0 Likes Given
- 0 Solutions
- 2 Likes Received
-
Latest posts by MikeFranz
Subject Views Posted 1505 07-05-2018 12:17 PM 1541 07-05-2018 11:39 AM 1084 05-16-2018 07:56 PM 44181 03-12-2018 04:32 PM 3809 03-12-2018 04:00 PM 3816 03-12-2018 03:51 PM 3841 03-12-2018 02:50 PM 4699 01-30-2018 10:54 AM 4785 01-29-2018 08:38 PM 1948 01-05-2018 03:54 PM -
Activity Feed for MikeFranz
- Posted Re: Assigning array to macro variable on SAS Programming. 07-05-2018 12:17 PM
- Posted Assigning array to macro variable on SAS Programming. 07-05-2018 11:39 AM
- Posted SAS Visual Analytics 8.2: Selecting crosstab row data role based on user input on SAS Visual Analytics. 05-16-2018 07:56 PM
- Posted Re: Renaming Column during Proc Import on SAS Procedures. 03-12-2018 04:32 PM
- Posted Re: Changing column name when you only know the order on SAS Programming. 03-12-2018 04:00 PM
- Posted Re: Changing column name when you only know the order on SAS Programming. 03-12-2018 03:51 PM
- Posted Changing column name when you only know the order on SAS Programming. 03-12-2018 02:50 PM
- Tagged Changing column name when you only know the order on SAS Programming. 03-12-2018 02:50 PM
- Tagged Changing column name when you only know the order on SAS Programming. 03-12-2018 02:50 PM
- Tagged Changing column name when you only know the order on SAS Programming. 03-12-2018 02:50 PM
- Posted Re: Creating changing variable names within %do loop on SAS Programming. 01-30-2018 10:54 AM
- Posted Creating changing variable names within %do loop on SAS Programming. 01-29-2018 08:38 PM
- Posted Re: Creating dynamic variable names & aggregating on SAS Programming. 01-05-2018 03:54 PM
- Got a Like for Re: Creating dynamic variable names & aggregating. 01-05-2018 03:54 PM
- Posted Creating dynamic variable names & aggregating on SAS Programming. 01-05-2018 03:35 PM
- Posted Applying parameter to aggregated measure on SAS Visual Analytics. 01-04-2018 06:16 PM
- Posted Re: First. Last. By on SAS Programming. 12-13-2017 02:10 PM
- Posted First. Last. By on SAS Programming. 12-13-2017 02:04 PM
- Posted Re: LAG function on SAS Programming. 11-20-2017 07:57 AM
- Posted LAG function on SAS Programming. 11-20-2017 06:58 AM
-
My Liked Posts
Subject Likes Posted 1 01-05-2018 03:54 PM 1 11-14-2017 10:40 AM
11-20-2017
06:58 AM
Hi, I've been trying to do something fairly simple for a couple of hours, but am struggling. I've read that using LAG function can lead to some unexpected results, but I'm not sure what I'm doing that could be causing the issue. I am trying to create the dataset below: Day End_Reason Prev_End_Reason Last_Day
1 Reason 1 "" 0
2 Reason 1 "" 0
3 Reason 1 "" 1
4 Reason 2 Reason 1 0
5 Reason 2 Reason 1 0
6 Reason 2 Reason 1 1
7 Reason 2 Reason 2 1
8 Reason 2 Reason 2 0
9 Reason 2 Reason 2 0
10 Reason 2 Reason 2 1
11 Reason 3 Reason 2 0
12 Reason 3 Reason 2 0
13 Reason 3 Reason 2 0
14 Reason 3 Reason 2 1
15 "" Reason 3 0 So, each row has an "End_Reason". If the previous row has Last_Day =1 would like the following observation to be have "Previous_End_Reason" = "End_Reason" from the previous row. I currently have the above, excluding the "Prev_end_reason" variable, which I am trying to attain. My code currently looks like this: data want;
set have;
if lag(last_day) = 1 then prev_end_reason = lag(end_reason);
RUN; For some reason, the column "Prev_End_Reason" remains blank throughout. If I use the following code: data want;
set have;
if lag(last_day) = 1 then prev_end_reason = 10;
RUN; It seems to work, putting a "10" in the correct places, so I can only assume there is something wrong with the bit "lag(end_reason)", but I can't work out what? Thanks!
... View more
11-14-2017
10:40 AM
1 Like
Thank you Jan. Just a quick note, I needed to remove the quotes around the "All", otherwise worked perfectly.
... View more
11-10-2017
10:43 AM
Hi, I have managed to import my data into CAS library through the data import GUI. I am now trying to move it from CAS to SAS (partly because it is a lot of data and I neither need nor want it stored in in-memory). I’m using the code below to move it to my SAS library: DATA transactions_2017_02;
set casuser.account (keep = CodeGeneralledgeraccount NameGeneralledgeraccount Transactiondate Period Code1 Name Balance);
RUN; However, it keeps giving me the error: ERROR: The maximum allowed bytes (104857600) of data have been fetched from Cloud Analytic Services. Use the DATALIMIT option to increase the maximum value. How would I implement this data limit option? I have tried the following: DATA transactions_2017_02;
set casuser.account (keep = CodeGeneralledgeraccount NameGeneralledgeraccount Transactiondate Period Code1 Name Balance);
datalimit = “All”; RUN; Any ideas on how to up the data limit?
... View more
11-02-2017
04:57 AM
This is great, thank you! I didn't know about this data _null_ option, very useful!
... View more
11-01-2017
01:31 PM
Hi, I have the following code: %let Report_Date = '31Dec2017'd; %let yesterday= '30Dec2017'd; %let last_week = '24Dec2017'd; DATA example&Report_Date.; set example; /* do stuff */ RUN; DATA example_compare_yesterday; set example&Report_Date. example&yesterday.; RUN; DATA example_compare_last_week; set example&report_Date. example&last_week.; RUN; I would like to make this code iterative, but don't have much of a grounding in macros (which I assume would be appropriate). I am looking to do the following: On any given date, "Report_Date" will have the current date I would like to automatically populate "yesterday" and "last week" with the relevant date such that I can generate the comparative datasets. Currently I have to populate all three dates to make this work. Any help would be appreciated. Thanks!
... View more
09-27-2017
02:26 PM
Thanks for the response. Understand everything until the final lines. How would I go about creating a new array from the existing ones, and setting the unwanted values to missing? And would the IRR function work with missing values? Thanks!
... View more
09-27-2017
02:25 PM
Ok, I haven't done macro coding, but I'll update the line to look like this. Thanks 🙂
... View more
09-27-2017
02:24 PM
Ah ok, that makes sense, I'll get rid of the superfluous code. Thanks!
... View more
09-27-2017
01:42 PM
Hi, I am looking to dynamically reference a variable name within an expression. Examples below: DATA out;
set have;
array values {&num_leases.};
array dates {&num_leases.};
array combined {2* &num_leases.} Var1-Var&num_leases.;
RUN In the above, I would like to create arrays with a length stored in the variable num_leases. For the "combined" array, I would like to then create variables names Var1 Var2... VarN, where N is the number of leases stored in num_leases. I then go on to store values in these arrays, and then I would like to find the last non-missing (i.e. ne .) entry in the "combined" array and use all non-missing elements in an expression, as below: do i = 1 to &num_leases.;
if combined{i} = . then leave;
end;
IRR = finance('xirr',combined{1}:combined{i});
output; So, in the above, I am looping through all elements in the "combined" array, and, when I find the first missing element, I am storing where in the array is it (i.e. element i). I then want to pass the non-missing elements in this array to the finance XIRR function to calculate an IRR. Would anyone be able to help me understand how to dynamically reference variable names, and then pass them to an expression, as per the above? Many thanks!
... View more
08-02-2017
12:37 PM
Yes, sure. Each row can be considered a separate "project". So, I have a cash outflow on each Draw_Date, of amount Draw_Amount for each project. I then have a terminal cash inflow on final_Value_Date of amount final_Value_Amount. I would like to calculate the IRR of these cashflows for each project. Is that clearer? Thanks
... View more
08-02-2017
12:10 PM
Hi! Thanks for the reply. I understand what you're doing, but perhaps the issue comes back (as mentioned by previous contributor) to me not explaining what IRR is. I've included a separate link in the above to explain the function. Thanks again!
... View more
08-02-2017
12:02 PM
Hi, good point. IRR is the internal rate of return. Is it the interest rate which makes the present value of a series of cashflows equal to zero. So, for instance, if we have monthly ouflows (payments) into a trading account for 12 months of $100, and the final value of the investment after 12 months $1,300, then the IRR is the interest rate at which one would discount all these cashflows to result in a zero present value. Here is a link to an article that explains it more clearly than I have: http://www.investopedia.com/terms/i/irr.asp I will add a "finance" tag to the question, thanks for the advice.
... View more
08-02-2017
11:26 AM
Hi, I have a dataset in the following format: Property Draw_Date_1 Draw_Amount1 ... Draw_DateX Draw_AmountX final_Value_Date final_Value
Property1 01/01/2015 -10,000 ... 16/07/2015 -40,000 31/12/2015 150,000
Property2 03/04/2015 -20,000 ... 18/07/2016 . 31/12/2016 140,000 As you can see in the above, each row represents one property, with the payment dates and amounts as the variables. Not each property has a drawdown for every drawdown date, in which case the corresponding amount and dates are set to missing. I would like, for each property, to calculate the IRR, using each drawdown amount/date as an outflow, and the final value/date as the eventual inflow. Any ideas on how to do this would be much appreciated. Many thanks,
... View more
07-20-2017
09:31 AM
Many thanks, reading through it now 🙂
... View more
07-20-2017
05:45 AM
Hey Ahmed. Thanks again for your help here, this is working perfectly! Couple of questions (I'm quite new to SAS, so don't completely understand the code here). 1) What is the "put" statement doing? I've read that it "holds the data", but I don't understand what that means? It means that it doesn't process the next row of data and allows you to output many rows before reinitialising the PDV? 2). Why is the "set" statement within the do loop? Many thanks! Mike
... View more
- « Previous
-
- 1
- 2
- Next »