turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Problem with prep question

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-15-2016 05:33 AM

Hi, I'm preparing for my Base Programming Exam and I'm stuck with one question from the Pass4Sure catalogue. The explanation doesn't really help:

The right answer is A. While I do understand why A doesn't produce a missing value in the last observation, I don't get why any of the other options should. I've pondered over this one for a while now but I'm not getting further. Especially option D should effectively do the same as A in my opinion.

I would appreciate your help!

Accepted Solutions

Solution

12-15-2016
05:44 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-15-2016 05:42 AM

options B and D use a simple totquantity + quantity calculation; they cause no automatic retain, always reference a missing value (totquantity), therefore the result will be missing.

option C is a simple syntax error.

---------------------------------------------------------------------------------------------

Maxims of Maximally Efficient SAS Programmers

Maxims of Maximally Efficient SAS Programmers

All Replies

Solution

12-15-2016
05:44 AM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-15-2016 05:42 AM

options B and D use a simple totquantity + quantity calculation; they cause no automatic retain, always reference a missing value (totquantity), therefore the result will be missing.

option C is a simple syntax error.

---------------------------------------------------------------------------------------------

Maxims of Maximally Efficient SAS Programmers

Maxims of Maximally Efficient SAS Programmers

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-15-2016 05:44 AM

Now I get it, thanks a lot!

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

12-15-2016 05:43 AM

Answer D uses the "+" operator which produces a missing value if one of the operands is missing.

The 0 in the retain statement only provides an initialization which is overwritten by the operation.

The 0 in the retain statement only provides an initialization which is overwritten by the operation.