Using a DATA step approach, declare a SAS ARRAY with the "variable prefix name" you want to include in your array variable list, such as VAR: in the ARRAY statement. Then using a DO / END code paragraph loop, create two new variables NVAR1 and NVAR2 starting referencing each of the variables in the array and outputting when the two variables are not equal (presumably in your yet-to-be-stated-clearly rqmts).
The using PROC SORT NODUPKEY, remove the duplicate combinations of NVAR1 and NVAR2.
The resulting output files should provide all combinations.
Another twist on this approach would be to reduce your input file to two SAS variables to start, generating observations, again in a DO/END loop. Then use PROC SQL to create an "all possible combinations" as can be identified with the PROC SQL DOC - found with Google advanced search argument below.
A most formidable SAS learning experience, I would say -- of course there are others on the SAS Discussion Forums listening channel who would rather do the coding task for you - I prefer to guide, rather than pull someone along into learning the SAS system.
Suggest you get phase 1 under your belt, by creating a new SAS file with two variables (generated from your VAR1-VAR5 file), then investigate using PROC SQL.
Scott Barry
SBBWorks, Inc.
Suggested Google advanced search argument, this topic/post:
all possible combinations multiple variables site:sas.com
-- a resulting link from the above search results to consider in your quest:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473718.htm