12-21-2015 06:07 AM
May I request someone to explain me about colon modifer in simple terms? Why it is necessary in input statement? What will happen when we read the input without colon modifer whereit is necessary to place the colon modifer?
12-21-2015 06:29 AM - edited 12-21-2015 06:30 AM
First you need to understand how your data is getting in your dataset. This is why you use input statement, you are going to input your data into your dataset.
The colon ( : ) modifier enables you to read nonstandard data values and character values that are longer than eight characters, but which contain no embedded blanks. The : indicates that values are read until a blank (or other delimiter) is encountered, and then an informat is applied. If an informat for reading character values is specified, the w value specifies the variable's length, overriding the default length.
|In order to read these values, you can modify list input with the colon ( : ) modifier, followed by the COMMAw.d informat, as shown in the program below. Notice that the COMMAw.dinformat does not specify a w value.|
Remember that list input reads each value until the next blank is detected. The default length of numeric variables is 8, so you don't need to specify a w value to indicate the length of a numeric variable.
This is different from using a numeric informat with formatted input. In that case, you must specify a w value in order to indicate the number of columns to be read.
Hope this helps.