@jeffgreen wrote:
Hi everyone,
I have imported a CSV file, and run proc tabulate. However, my variables 'season' and 'day' are in alphabetical order, and I want them to be inlogical order. Therefore, I have used CARDS to create 2 new datasets- 'seasons', which is the month in correct order, and 'orderday' which is the day in correct order.
My question is, how do I use these two datasets to create a proc tabulate like the one described above? I want to do this by using FORMAT and INFORMAT.
Thanks in advance.
Since we would have to see exact values to make any sort of useable informat then provide the data step code with the cards statement. Copy the code and paste into a code box opened on the forum with the </> icon to prevent the forum message windows from reformatting text which can cause such code not to execute.
Most consistent would be to read the values into a numeric variable so the order is easier to maintain with an Order=data in proc tabulate and then a format to display the values.
Better might actually be to provide some example of the CSV file and the code you use to read that. Reading the CSV would be best time to use an informat to avoid creating additional variables that may be needed after these values that don't sort as desired.