You told it to read the first 35 bytes into the first variable.
You can use the LIST statement
data _null_;
input ;
list;
cards;
animesh mardi 25
nahir sharma 26
agent rank 22
niharika ghatgey 23
pushpanjali kujur 22
;
to see a nice listing that shows why that cannot work for the data you posted.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0
675 animesh mardi 25
676 nahir sharma 26
677 agent rank 22
678 niharika ghatgey 23
679 pushpanjali kujur 22
NOTE: DATA statement used (Total process time):
If you want your code to work the data need to look like this:
*---+----1----+----2----+----3----+----4-;
cards;
animesh mardi 25
nahir sharma 26
agent rank 22
niharika ghatgey 23
pushpanjali kujur 22
;
You could add the : modifier to the input statement so that it only uses the informat to GUESS what length you wanted to define the variable. But you would still need to also add the & modifier and change the data to have two spaces after the string (and not have two spaces embedded in the string).
data abc;
input stud & :$35. Age;
cards;
animesh mardi 25
nahir sharma 26
agent rank 22
niharika ghatgey 23
pushpanjali kujur 22
;
You could also change the data to use something other than space are the delimiter and add an INFILE statement to tell SAS to use that delimiter.
data abc;
infile cards dlm='|';
input stud :$35. Age;
cards;
animesh mardi|25
nahir sharma|26
agent rank|22
niharika ghatgey|23
pushpanjali kujur|22
;