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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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