SAS Interview Question with Answer : 86 and 87

Ques 86 : 
Suppose we have a dataset (One) which contains 100 numeric variables like V1, V2, V3.....V100. Create a new dataset (Two) with new variables N1, N2, N3,.....N98 with following condition :
N1 - Stores the sum of value V1, V2, V3
N2 - Stores the sum of value V2, V3, V4
N3 - Stores the sum of value V3, V4, V5
.
.
.
.
N98 - Stores the sum of value V98, V99, V100.


Ans : Firstly i have created dataset One with following array code :

and the output of dataset one is as below :


Now code for desired dataset (Two):



and the output is as desired :




Ques 87 : What would happen, if we don't supply the third argument (Length) in SUBSTR function ?

Ans :  If we omit the third argument from SUBSTR function then in result, it would return all the characters from the string, starting from the starting position (Second argument) of SUBSTR function.

We can use following syntax : 


Output :