I have a numeric variable in a SAS dataset which is length 8. Despite of its length being 8 bytes it contains only one number. See the example bellow.
my_variable
1
2
5
9
0
3
The problem is that I need this variable to be only 1 byte in length and SAS doesn't accept it. I am running the following code:
data my_data_2;
set my_data;
length my_variable 1;
run;
And SAS reports this error message:
ERROR 352-185: The length of numeric variables is 3-8.
1 - So, why I cannot have a numeric variable with a length less than 3 (or greater than 8) bytes?
2 - Is there a way to manage this? I really need this variable to be length 1.
Edit - adding more context:
I need this specific variable to be length one because I need to submit this dataset to a regulatory authority in my country. They demand this variable to be numeric and length one, otherwise their validation program will not be able to read it. Also, it is needed to be submitted as .DBF file (which is simply done by using SAS proc export
statement).
I tried to use Microsoft Access 2013 to change length to 1 and it works. The problem is that Access 2013 does not read or save .DBF as it is an old file format. So, I wanted to change the length in SAS and simply export it .DBF.