BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LAtwood
Calcite | Level 5

I am having a problem adding "pay_period" variable to a title using Proc Report. I am trying to use #byval.  This is a stored process.

I have attached the code.

Thanks

Lori

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Really simple things to check:

  1) the use of #byval reuires that you have a BY statement in your code. So even if you have PAY_PERIOD in your COLUMN and even if you have the reference to #BYVAL in your TITLE statement, you still need to use a BY statement  inside the PROC REPORT code, such as:

BY PAY_PERIOD;

also in your PROC REPORT step in order for the reference in the title statement to work.

   

  2) Usually, in order to use #BYVAL/#BYLINE/etc, you also need:

OPTIONS NOBYLINE; before the step that contains the special by variable reference.

  

Generally, the use of the BY variable special strings works very well with ODS -- so even in a stored process, you should see the use of the information (do note that in order to use a BY statement in PROC REPORT, the data must be sorted, by PAY_PERIOD). If you have checked #1 and #2 and your BY reference still does not work, you should open a track with Tech Support on this matter.

cynthia

View solution in original post

2 REPLIES 2
Cynthia_sas
SAS Super FREQ

Really simple things to check:

  1) the use of #byval reuires that you have a BY statement in your code. So even if you have PAY_PERIOD in your COLUMN and even if you have the reference to #BYVAL in your TITLE statement, you still need to use a BY statement  inside the PROC REPORT code, such as:

BY PAY_PERIOD;

also in your PROC REPORT step in order for the reference in the title statement to work.

   

  2) Usually, in order to use #BYVAL/#BYLINE/etc, you also need:

OPTIONS NOBYLINE; before the step that contains the special by variable reference.

  

Generally, the use of the BY variable special strings works very well with ODS -- so even in a stored process, you should see the use of the information (do note that in order to use a BY statement in PROC REPORT, the data must be sorted, by PAY_PERIOD). If you have checked #1 and #2 and your BY reference still does not work, you should open a track with Tech Support on this matter.

cynthia

LAtwood
Calcite | Level 5

Thanks again Cynthia!  Those were the two steps I was missing.

Lori

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 701 views
  • 0 likes
  • 2 in conversation