Is there anyway to make the designated SPLIT value apply to strings displayed through the table besides main and column titles? I'm using SAS 9.4.
I pre-incorporated in one test but it didn't seem to work. It didn't work either even when I tried concatenating some string variables via COMPUTE block in PROC REPORT. What am I missing?
data addy;
infile datalines dlm='|';
input name ~$15. address ~$15. city $ state $;
datalines;
Debby Jones|1234 Johnny St|Chicago|IL
Joe Smith|2345 Bobby Dr|New York|NY
Ron Lee|3456 Suzy Ln|Miami|FL
;
run;
data addy_report_feed;
set addy;
catty=catx('~',name,address,catx(', ',city,state));
run;
/* test 1 */
proc report data=addy_report_feed split='~';
column state city name catty;
define state / display noprint order=internal;
define city / display noprint order=internal;
define name / display noprint order=internal;
define catty / group 'Mailing~Address' flow width=30;
break after catty / skip;
run;
/* test 2 */
proc report data=addy_report_feed split='~';
column state city address name addblock;
define state / display noprint order=internal;
define city / display noprint order=internal;
define address / display noprint order=internal;
define name / display noprint order=internal;
define addblock / computed 'Mailing~Address' flow width=30;
compute addblock / char length=40;
addblock=catx('~',name,address,catx(', ',city,state));
endcomp;
/* break after addblock / skip;*/
run;
Use escapechar:
ods escapechar='^';
.................
compute addblock / char length=40;
addblock=catx('^n',name,address,catx(', ',city,state));
endcomp;
Fixed a problem
If I understand you correctly you appear to be trying to turn your columns of data into rows just using PROC REPORT.
An easier approach might be to transform your data first by creating a general text column that contains name on row 1, address on row 2, city on row 3, state on row 4 and so on. You could use a DATA step or PROC TRANSPOSE for this.
Once your data is transformed it makes your PROC REPORT a lot easier.
Use escapechar:
ods escapechar='^';
.................
compute addblock / char length=40;
addblock=catx('^n',name,address,catx(', ',city,state));
endcomp;
Fixed a problem
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.