Dear SAS community, I am a new user of SAS and I guess this is a fairly easy question but I have been searching the web and I can't solve it. I receive a file on a weekly basis containing trainings that employees have to take and I need to pivot some of its columns. The first 4 variables are always called the same (they are basic employees info), but the rest varies (the variables names change and I have a different number of columns each time, as each week different trainings have to be taken). Here is my code: PROC IMPORT OUT= IMPORT.Mandatory_Trainings DATAFILE= "Excel file path" DBMS=EXCEL REPLACE; Range="A1:AAA100000"; GETNAMES=Yes; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN; proc transpose Data=IMPORT.Mandatory_Trainings OUT=Base.Mandatory_Trainings_Pivot; BY ID Employee_Name Overall__Training_Status General_Exclusion__Status; VAR XXXXX; run; The line "VAR XXXXX;" is where I need to change my code. I put the name of the first and last training and separated them with "--" ("First_Training_Name -- Last_Training_Name_") and it worked perfectly fine but I want a more automated way where SAS select and pivot all variables that are between column 5 and the last one. Any advice on how to do this? Thanks in advance for the help.
... View more