> I run following code:
> data admit;
> input ID $ 1-4 Name $ 6-19 Sex $ 21 Age 23-24
> Date 26-27 Height 29-30 Weight 32-34
> ActLevel $ 36-39 Fee 41-46;
> format fee 6.2;
> run;
>
> I guess 'ID $1-4',it will produce a parameter,its
> width is 4,but I don't understand 'Sex $21' width is
> 1,why? And 'Weight 32-34' width is 8,why?
>
these are column number ranges and in SAS without other statements to define the variable attributes the column numbers serve that purpose.
$1-4 character length 4
$21 same as $21-21 character length 1
32-34 NO $ sign numeric. All numerics default to lenght 8.
>
> Where is 5,20,22,25,28,31,35,40? Why omit them?
Those columns are skipped. No mistery.
You need to read about COLUMN INPUT. That will answer most of your questions.
This INPUT statement syntax was developed with the very first SAS version from the late sixties. If may seem odd to some.
... View more