BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
joycefilm
Fluorite | Level 6

joycefilm_0-1688626238891.png

Hellow all,

I want to output table header without the numbers and @ sign, but use #byval(param) in the code, sorted by param, to avoid alphabetical sorting, so customize the order using numbers to control the order

  • My code is as follows:

  • title j=c "#byval(param)";
  • proc sort data=test out=table;
  • by param;
  • define param /group page noprint;
  • break befpre param/page;
  • run;
  • please give me some suggestions,thanks.
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

@joycefilm wrote:

param values cannot be sorted alphabetically, so I use numbers to customize the order. Now I want to output tables without numbers


 

If I am understanding you properly, you want to create a variable that has the value with numbers and @ sign (I think you already have that), let's call this variable PARAM, and another variable named PARAM1 which does not have the numbers and @ sign.

 

Then sort by both PARAM and PARAM1, set the options NOBYLINE, and in PROC REPORT use

 

by param param1;

 

Then in the title statement refer to #BYVAL2.

--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

PROC SORT does not display printed output, so it is not going to work with #byval. Nor is there are DEFINE or BREAK statement in PROC SORT. Are you trying to do this with PROC REPORT?

 

Please provide code that works EXCEPT for the #byval part, then it should be really simple to add in #byval to the title.

--
Paige Miller
joycefilm
Fluorite | Level 6
sorry,I write mistake. It's proc report.
My code is as follows:
title j=c "#byval(param)";
proc report data=test out=table;
by param;
define param /group page noprint;
break befpre param/page;
run;
param values cannot be sorted alphabetically, so I use numbers to customize the order. Now I want to output tables without numbers

PaigeMiller
Diamond | Level 26

@joycefilm wrote:

param values cannot be sorted alphabetically, so I use numbers to customize the order. Now I want to output tables without numbers


 

If I am understanding you properly, you want to create a variable that has the value with numbers and @ sign (I think you already have that), let's call this variable PARAM, and another variable named PARAM1 which does not have the numbers and @ sign.

 

Then sort by both PARAM and PARAM1, set the options NOBYLINE, and in PROC REPORT use

 

by param param1;

 

Then in the title statement refer to #BYVAL2.

--
Paige Miller
joycefilm
Fluorite | Level 6

I obtained the results I desired by using your method. Thank you very much!

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Discussion stats
  • 4 replies
  • 1630 views
  • 2 likes
  • 2 in conversation