Hello @knveraraju91,
While I was writing my post, @Astounding has already given the explanation ...
The explanation why your code failed is: You used column input inadvertently. SAS interpreted the specification "$1" as "read character value from column 1." Hence, all of your variables received the first letter in each line, the other letters were ignored. So, it only seemed that the first line was read correctly, because all letters happened to be equal to the first one.
What you probably wanted to do was formatted input, but informat specifications such as $1. require a period. The following INPUT statement is correct:
input AESER $1. +1 AESDTH $1. +1 AESLIFE $1. +1 AESHOSP $1. +1 AESCONG $1. +1 AESDISAB $1. +1 AESMIE $1. +1 INFECDIS $1.;
Now the "+1" pointer controls make sense, because with formatted input the blanks between the values are not skipped automatically.
The input style which skips blanks automatically (but which also requires blanks or other delimiters between data values) is list input. This in turn can be combined with informat specifications (which in your example have the main purpose of assigning type character and length 1 to the variables) and is then called modified list input:
input AESER :$1. AESDTH :$1. AESLIFE :$1. AESHOSP :$1. AESCONG :$1. AESDISAB :$1. AESMIE :$1. INFECDIS :$1.;
All of these repetitive specifications can be abbreviated by using parenthesized lists of variable names and informat specifications. In particular, modified list input could be written as:
input (AESER AESDTH AESLIFE AESHOSP AESCONG AESDISAB AESMIE INFECDIS) (:$1.);
... View more