Extracting selected variables from the hpgenselect procedure using code

Several SAS procedures generate code from which the user may extract critical information.

In the example below I extract variables selected by proc hpgenselect and input these to proc corr and proc gampl without writing intermediate results to the harddrive:

The generated sourcecode ‘code’ is read a line at the time. Appropriate text lines are kept and concatenated into a single string using retained variables for identification (expr) and text (text). The variable containing variable names are stored in a macro variable ‘variables’ and a data file test in the work library. The list may be inspected in both the data file work.test or in the SAS log.

0 views0 comments

Recent Posts

See All

SAS University Edition load error solution

Using SAS University Edition with VirtualBox in Fedora requires kernel signing of 3 modules. Avoid this by disabling Secure Boot in BIOS settings. Secure Boot makes it impossible to load nonauthorized

©2020 by Danish Institute for Data Science. Proudly created with