Hi,
within my proc-report-syntax I want to rename the Rbreak-Line into "This is a test". But the result is short: "This i". So: How can I increase the length?
Thank you!
proc report data=sashelp.cars completerows ;
columns origin make type,(msrp invoice) Differenz;
define origin/group style(column)=[cellwidth=10cm] style(header)=[background=yellow] ;
define make/ group ;
define type/across;
define msrp/"Mittelwert" mean;
define invoice/"Summe v. Invoice" sum;
define Differenz/computed;
Break after Origin/ summarize style={font_weight=bold};
RBreak after /Summarize;
compute Differenz;
Differenz= _c3_ - _c4_ ;
endcomp;
compute after origin;
if not missing(_break_) then origin= "Gesamt";
endcomp;
compute after;
if not missing(_break_) then Origin="This is a test";
endcomp;
where origin in("Asia", "Europe");
run;
Or make a COMPUTED vairable.
proc report data=sashelp.cars completerows nowd;
columns origin _origin make type,(msrp invoice) Differenz;
define origin/group style(column)=[cellwidth=10cm] style(header)=[background=yellow] noprint ;
define _origin/computed style(column)=[cellwidth=10cm] style(header)=[background=yellow] ;
define make/ group ;
define type/across;
define msrp/"Mittelwert" mean;
define invoice/"Summe v. Invoice" sum;
define Differenz/computed;
Break after Origin/ summarize style={font_weight=bold};
RBreak after /Summarize;
compute Differenz;
Differenz= _c4_ - _c5_ ;
endcomp;
compute _origin/character length=80;
_origin=origin;
endcomp;
compute after origin;
if not missing(_break_) then _origin= "Gesamt";
endcomp;
compute after;
if not missing(_break_) then _Origin="This is a test";
endcomp;
where origin in("Asia", "Europe");
run;
Hi @Konkordanz,
Origin is a character variable of length 6 in sashelp.cars, so you will need to increase its length in a preliminary step before you can assign longer values to it:
data cars; length Origin $14; set sashelp.cars; run; proc report data=cars ...; ...
Or make a COMPUTED vairable.
proc report data=sashelp.cars completerows nowd;
columns origin _origin make type,(msrp invoice) Differenz;
define origin/group style(column)=[cellwidth=10cm] style(header)=[background=yellow] noprint ;
define _origin/computed style(column)=[cellwidth=10cm] style(header)=[background=yellow] ;
define make/ group ;
define type/across;
define msrp/"Mittelwert" mean;
define invoice/"Summe v. Invoice" sum;
define Differenz/computed;
Break after Origin/ summarize style={font_weight=bold};
RBreak after /Summarize;
compute Differenz;
Differenz= _c4_ - _c5_ ;
endcomp;
compute _origin/character length=80;
_origin=origin;
endcomp;
compute after origin;
if not missing(_break_) then _origin= "Gesamt";
endcomp;
compute after;
if not missing(_break_) then _Origin="This is a test";
endcomp;
where origin in("Asia", "Europe");
run;
The insertion of _origin before msrp and invoice in the COLUMN statement changes the column numbers in the formula for Differenz:
Differenz= _c4_ - _c5_ ;
Thank you for your two options. Both are good!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.