BookmarkSubscribeRSS Feed
Nietzsche
Lapis Lazuli | Level 10

page 372

the second dot point should be

Create a macro variable named Location...

since the "&" is part of the macro variable code, not part of the actual variable name. "&" is an illegal character for a variable name.

Nietzsche_0-1669150976818.png

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Tom
Super User Tom
Super User

Are you sure?  Is there any mention of a macro variable named LOCATION before?  If LOCATION has a value that is a valid macro variable name then you could definitely create a macro variable named &LOCATION.

252  %let location=myname;
253  %let &location=102;
254  %put &&&location;
102
Nietzsche
Lapis Lazuli | Level 10

yes I am sure, what you see in the attached is the entire question from beginning to end for "scenario 9", and I am sure it is an error/typo because

 

if you look at the solution to scenario 9, statement 1, it says

Nietzsche_2-1669153461585.png

But in the Directions section of scenario 9, it says

Nietzsche_3-1669153515142.png

I mean one of them is wrong or both are correct but inconsistent usage which is confusing.

Nietzsche_1-1669153348609.png

 

 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Nietzsche
Lapis Lazuli | Level 10

on page 50. 

figure 4.3, the tab should be "ActivityLevels" or "activitylevels" and not "adv". 

Nietzsche_0-1669894009038.png

 

Because both the exercise.xlsx provided and on page 51 name/refers that sheet as "activitylevels" and "ActivityLevels" respectively.

 

Nietzsche_1-1669894082490.png

Nietzsche_2-1669894117743.png

Three different inconsistent naming across figure, code and data set provided.

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Nietzsche
Lapis Lazuli | Level 10

this one is a doozy, page 212...

Nietzsche_0-1670324900670.png

Who the F charges 75% annual interest rate? Mexican cartels don't even charge that much.

 

Did the author really just write the book and think hmmm $1069 interest earned on a $1000 principal after only 12 months seems reasonable? 

Nietzsche_2-1670325216529.png

Nietzsche_0-1670325686624.png

 

 

 

 

Interest rate went back to a more reasonable 7.5% on page 213.

Nietzsche_1-1670325114282.png

 

 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
ballardw
Super User

"Did the author really just write the book and think hmmm $1069 interest earned on a $1000 principal after only 12 months seems reasonable? "

 

Since we have banks that are paying less than $2 annually on $10,000 in savings accounts I don't see any quibble with values chosen to demonstrate code.

Quentin
Super User

I hope they explained the SUM statement before this.  Looking at that first example, I thought it would throw a missing values note from the execution of:

earned+(amount+earned)*rate ;

thinking that earned would be missing so amount+earned would return missing.  But because of the sum statement, earned is initialized to 0.  So that's important to know in order to understand this step. For this sort of step where you don't actually need to RETAIN a value, I think the sum statement makes a lesson in DO loops more complex than it needs to be.

 

The second example is cleaner, but since it doesn't actually rely on the sum statement I would have written it as:

data work.earn ;
  value=2000 ;
  do year=1 to 20 ;
    interest=value*.075 ;    
    value=value+interest ; *assignment statement, not sum statement ;
    output ;
  end ;
run ;
The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at https://www.basug.org/events.
Nietzsche
Lapis Lazuli | Level 10

Since we have banks that are paying less than $2 annually on $10,000 in savings accounts I don't see any quibble with values chosen to demonstrate code.

You're justifying an pretty obvious typo (a misplaced decimal place, 0.75 instead of .075) with a flawed logic. Zero interest rate is pretty common in many in many banks around world right now and through out history, eg. Japanese banks have been paying 0 interest rate or near since the 80s and so do many consumer related loan are interest free etc.  You're justifying a very unrealistic large number because there is 0 rate exists?

 

Technically there is nothing wrong with 75% interest rate to demonstrate the code with 75% interest but it's pretty obvious a typo because

 

1. there author do NOT put 0 in front a decimal, he/she would write .1 not 0.1 

Nietzsche_0-1670348707025.png

Nietzsche_1-1670348737758.png

2. The interest rate .075 is used in multiple places in that chapter, 0.75 only once.

 

3. As a someone who pass CFA level 2 and with a finance degree, I have NEVER EVER ever seen a 75% interest rate or anywhere near that high in any finance books I have read that is used to demonstrate a time value of money (TVM) concept. So it was extremely confusing when I look at the numbers in this example.

 

Because if you present this result to anyone with finance background, or reasonable person, they will think 0.0625 is the Annual Rate at 6.25% which is a reasonable annual rate and they will try to calculate the interest with Future Value formula, FV = PV (1 + r/m), and in this case it would be $5.21 interest earned. And when I say 62.50 in the earned, I was like how he got 62.50? Maybe that is the annual interest rate etc I was going back and forth between the code and the result before I realised that the author used a 75% interest rate.

Nietzsche_3-1670349360573.png

 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Nietzsche
Lapis Lazuli | Level 10

pg 266. both code works but just inconsistent for no good reason.  The whole section talks about IF statement, then they use WHERE statement ?

Nietzsche_0-1670760242788.png

 

 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Nietzsche
Lapis Lazuli | Level 10

page. 276

 

Nietzsche_0-1670906566823.png

Extra right parenthesis?

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
Tom
Super User Tom
Super User

@Nietzsche wrote:

page. 276

 

Nietzsche_0-1670906566823.png

Extra right parenthesis?


Or perhaps the missed the opening bracket that would indicate that BASIS is an optional argument.   What is the style for how that book shows syntax for function with optional arguments?  Here is how the on-line help shows it (which also has its own issues since the comma is show outside of the angle brackets indicating that the extra comma is required when adding it without a BASIS value is actually an error).

 

Syntax

YRDIF(start-date, end-date, < basis>)
Nietzsche
Lapis Lazuli | Level 10

The book uses < > to indicate optional argument.

Nietzsche_0-1670925146501.png

 

 

 

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

Welcome to the Certification Community

 

This is a knowledge-sharing community for SAS Certified Professionals and anyone who wants to learn more about becoming SAS Certified. Ask questions and get answers fast. Share with others who are interested in certification and who are studying for certifications.To get the most from your community experience, use these getting-started resources:

Community Do's and Don'ts
How to add SAS syntax to your post
How to get fast, helpful answers

 

Why Get SAS Certified.jpg

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 26 replies
  • 2036 views
  • 2 likes
  • 5 in conversation