Hi All, I've come across a challenge I'm struggling to resolve. I have a SAS dataset created from an MS SQL Server table which has a field stored in SQL as varchar(500). This field shows as character length 500 in the SAS dataset as expected. Values showing in this field are simply single digits (0,1,2,etc.) and I need to convert these to number. So normally should be case of using an input function with the correct format however when I do this I get the following error message: data newdata; set olddata; format newvar 3.; newvar=input(oldvar,3.); run; NOTE: Invalid numeric data '30002020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202 02020202020'X I think this means the data is stored in hex format. However I'm confused as to why it is showing in the data s 0,1,2, etc even when I've removed all formats using proc datasets. If it helps the value I need in this case is always the second character of the above string. So my questions are: - is this really a hex format or something else? - and how do I convert it to the numeric value of what I'm seeing in the data? Incidentally, the alternative approach of doing this on the SQL side using cast or convert isn't an option as I don't have the permissions to modify the data. Hence trying to do the conversion in SAS once the data is extracted. Any help gratefully received! Thanks all
... View more