@Uzi wrote: Hey Experts, after a few attempts I realized I had a problem.My data is changing. For example, a policy number can appear once a number and once a number and a letter. The proc import step checks for the first few lines(20) and then determines the format of the field. In my case, the program encountered only a number and therefore determined numerical while it could also be a charcter. Is it possible to update SuryKirn's program so it will know determine the format of the fields correctly? A reminder: I need to select only a few files (a specific files) from the folder (not all the files in the folder) and apend them in to one file. Thanks in advance for the help and forgiveness for my ignorance in sas.
For CSV files you can change the GUESSINGROWS option, but that won't solve the problem if the particular subset of data in that CSV file happens to only have ID codes that look like numbers. If you don't want SAS to guess at how to define your variables then do not use PROC IMPORT to read your files. Instead write you own data step to read the files and you will have complete control over how the variables are defined.
... View more