@Reeza : I want to use this process for all type of informations :unfamiliar or familiar.
When, I give more than 500 external files -as input- I will get a sas file formats.
If you really know nothing about the files then just run PROC IMPORT on the text files. It will probably do as good of a job as your code could.
You should have enough ideas now to program your macro. Why not take a stab at it?
So once you have the data into a SAS dataset you now runs some algorithms on it to try and determine what type to use.
You can find the max length. You can count how many missing values. Even how many distinct values.
You can try using various INFORMATS on it to see if the value is a number or a date or a time.
_missing = missing(value);
_numeric = length(value)<=32 and not missing(input(value,??comma32.)) ;
_datetime = not missing(input(value,??anydtdtm.));
_date = not missing(input(value,??anydtdte.));
_time = not missing(input(value,??anydttme.));
Make up your own rules for what type to use for empty fields. Or how to handle fields where 99% is numeric but there are just a few non-numeric values.
@Tom : please, what do mean by "Why not take a stab at it? "
It means try to write your the desired macro. If you need further help, post what you've tried and identify where you're having issues.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: