03-11-2013 05:35 PM
I am running the below merge statement for two files--which are attached. When I run the statement, the values for CourtJurisdiction from each file are missrepresented in the merged file for both. In the underlying files, the value for NYS is 40426 and the value for NYC is 23213. In the merged file, the NYS is 40424 and the value for NYC is 23212.
I cannot seem to figure out why this is happening. There are many other files in this merge statement, but I just enclosed two for this example. There are also several processes that run before this statement. If anyone has any ideas, please let me know.
length County $ 50 Year 3 Filing $ 30 FilingType $ 30 AgeRange $ 30 CourtJurisdiction 3;
by County Year Filing FilingType AgeRange;
03-11-2013 10:16 PM
By throwing away the rest of the number. If you try to put 8 bytes of data into 3 bytes of storage something gets lost.
Try this little example using the value 40426. You can see that when the three byte value is read back in the '40'x in the 4th byte is now '00'x.
length len8 8 len3 3 ;
put (len8 len8 len3 len3) ( = z5. +1 = hex16. /);
03-12-2013 06:58 AM
What Tom said.
SAS even has a function so you check it in a data step.
Need further help from the community? Please ask a new question.