I found out the answer by creating the color.txt file and submitting in the SAS Univ Edn. However,I couldn't figure out the reason for the answer.
The question is :
Given the text file COLORS.TXT:
----+----1----+----2----+---- RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET CYAN WHITE FUCSIA BLACK GRAY BROWN PINK MAGENTA
The following SAS program is submitted:
data WORK.COLORS; infile 'COLORS.TXT'; input @1 Var1 $ @8 Var2 $ @; input @1 Var3 $ @8 Var4 $ @; run;
What will the data set WORK.COLORS contain?
options are:
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE RED ORANGE BLUE INDIGO BLUE INDIGO CYAN WHITE CYAN WHITE GRAY BROWN GRAY BROWN
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE BLUE INDIGO CYAN WHITE GRAY BROWN
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET CYAN WHITE FUCSIA BLACK GRAY BROWN PINK MAGENTA
RTM. What does the documentation say regarding the trailing @?
holds an input record for the execution of the next INPUT statement within the same iteration of the DATA step. This line-hold specifier is called trailing @.
Restriction | The trailing @ must be the last item in the INPUT statement. |
Tip | The trailing @ prevents the next INPUT statement from automatically releasing the current input record and reading the next record into the input buffer. It is useful when you need to read from a record multiple times. |
See | Using Line-Hold Specifiers |
Example | Holding a Record in the Input Buffer |
I found out the answer by creating the color.txt file and submitting in the SAS Univ Edn. However,I couldn't figure out the reason for the answer.
The question is :
Given the text file COLORS.TXT:
----+----1----+----2----+---- RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET CYAN WHITE FUCSIA BLACK GRAY BROWN PINK MAGENTA
The following SAS program is submitted:
data WORK.COLORS; infile 'COLORS.TXT'; input @1 Var1 $ @8 Var2 $ @; input @1 Var3 $ @8 Var4 $ @; run;
What will the data set WORK.COLORS contain?
options are:
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE RED ORANGE BLUE INDIGO BLUE INDIGO CYAN WHITE CYAN WHITE GRAY BROWN GRAY BROWN
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE BLUE INDIGO CYAN WHITE GRAY BROWN
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET
Var1 Var2 Var3 Var4 ------ ------ ------ ------ RED ORANGE YELLOW GREEN BLUE INDIGO PURPLE VIOLET CYAN WHITE FUCSIA BLACK GRAY BROWN PINK MAGENTA
@Sathiskumar_D Please do not post the same question multiple times. It will not increase the number of responses and isn't helpful.
When I posted the question first time, it didn't aacept the question.I am not aware of the fact that my previous question was posted.My apologies.
RTM. What does the documentation say regarding the trailing @?
holds an input record for the execution of the next INPUT statement within the same iteration of the DATA step. This line-hold specifier is called trailing @.
Restriction | The trailing @ must be the last item in the INPUT statement. |
Tip | The trailing @ prevents the next INPUT statement from automatically releasing the current input record and reading the next record into the input buffer. It is useful when you need to read from a record multiple times. |
See | Using Line-Hold Specifiers |
Example | Holding a Record in the Input Buffer |
SAS prep Guide says that '@' or '@@' cannot be used with @pointer control, with column input, nor with the MISSOVER option.In my question, however, there is '@'pointer control.
Either it's incorrect or you're misunderstanding the text.
What's the page reference for this, I'm assuming SAS Base Certification Prep guide, what version?
http://support.sas.com/publishing/cert/basecertguide3.html
It is Third Edition (Page # 608 and Chapter 20).They had provided an example where '@' pointer control was NOT used.However, the caveat, that was mentioned, is for double trailing '@@'.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.