BookmarkSubscribeRSS Feed
mnew
Calcite | Level 5
Greetings:

Puzzled by this quiz today.

Question: A record that is being held by a single trailing @ is automatically released when
a. the input pointer moves past the end of the record
b. the next iteration of the data step begin

I know b is correct. But I don't understand why A is incorrect. Why would SAS want to keep a record when the pointer has moved past the end? I guess it must be useful in some cases?
Thank you!
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The specific event reflected in answer "a" would only be relevant to action taken with an other INPUT statement (as coded in your SAS program). So that action would need to either have or not have the appropriate "@" or "@@" (or neither) coded to determine how the current input record buffer condition is changed by SAS -- it would not happen automatically, as in the case a single "@" and iterating to the top of a DATA step execution.

Scott Barry
SBBWorks, Inc.
ballardw
Super User
An example of this being useful comes with files that have mixed record content resulting in different lengths in an irregular occurence pattern. Consider a data logger that has period output at hourly and daily intervals but may contain an event triggered record at any time of day and each of these record formats has a different length.

And then throw in a possibility of an incomplete record because of data transmission issues. If you read past the end of a record you can test for conditions to output diagnostics of approximately where the data file has problems and still capture the 'valid' data up to the break.

I'm sure that's not the only use but the one I remember dealing with that used this.
mnew
Calcite | Level 5
Thanks to you both!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1960 views
  • 0 likes
  • 3 in conversation