🎴 Flashcard Mode
SAS and C Programming Fundamentals
Card1 / 20
Mastered0
Review0
QuestionClick to flip
Flat file structure is as below 1----5----10 dan 23 45 bob 44 50 sue 30 80 mam 40 50 The following code is submitted. data temp; infile ‘file specification’; input x $ 1-3; if x='sue' then input age 5-6; else input height 8-9; run; what would be the value of variable AGE in the dataset TEMP when variable X has the value ‘Sue’?
AnswerClick to flip back
A
40
💡 Explanation:
Without a trailing @ or @@ in the first input statement, the next input statement reads from the next line. Thus, when x is 'sue' (read from line 4), the subsequent input age statement reads from line 5 ('mam 40 50'), where columns 5-6 contain 40.