BookmarkSubscribeRSS Feed
sarunas
Calcite | Level 5
Hello SAS professionals,

I’d be very thankful if someone could help me to solve a problem I faced:

Using proc REPORT I want to print to ODS HTML output a SAS table of about 700 rows, but there are written only 4 rows in a generate HTML output. How can I solve this problem ? Thanks.
8 REPLIES 8
Kathryn_SAS
SAS Employee
Are the variables in your data set numeric? If so, try defining them as DISPLAY:

define var / display;

Please send your code if you are still having problems.
sarunas
Calcite | Level 5
Hello Kathryn,
thank you a lot for your assistance 🙂
Yes, values of variable that I want to display in rows are numerical. Actually a it is a date. But I need to define this variable as GROUP. Here is a sample of my program :

proc report data=a nowd ;

column date statistic, package_grp, count;

define date / group descending;
define statistic /across '' ;
define package_grp /across '';
define count /analysis;

run;

When I change the define option for date variable from GROUP to DISPLAY, then SAS terminates with error :

ERROR: date is not an ORDER, GROUP, or ACROSS variable and is marked DESCENDING.

Well, actually I need date to be defined as GROUP

I hope this is not a SAS bug ?
Thank you, Kathryn

with best regards,
Sarunas
Kathryn_SAS
SAS Employee
For numeric variables, if you do not define another usage, the default usage is ANALYSIS SUM. In your original question, I suspected that this is what was happening with your date variable. In order to prevent it from summing, I suggested defining another usage such as DISPLAY. ORDER or GROUP would be fine also. If you are using other options, such as DESCENDING, ORDER or GROUP must be used. This is not a bug.
sarunas
Calcite | Level 5
Well, but why are there only 4 rows in a display output ? There are about 700 of rows in SAS table, and date variable has different values in each row.

thnaks
Sarunas
Kathryn_SAS
SAS Employee
How do you define date when you only see 4 rows in the output? This might be an issue that is better handled by Technical Support through the tracking system. If you could email your code and a sample of the output to support@sas.com, that would be helpful.
sarunas
Calcite | Level 5
How do you define date when you only see 4 rows in the output? This might be an issue that is better handled by Technical Support through the tracking system. If you could email your code and a sample of the output to support@sas.com, that would be helpful.

Well, I define the date variable as GROUP. I can't understand why only first 4 rows are displayed... Why not 5 or 6 first rows. In a sense of substance of data all rows in table are equal 🙂

Right, I'll try to contact sas support.

Thank you Katheryn for your help.

best regards,
Sarunas
deleted_user
Not applicable
Hi,
I think the basic missunderstanding is in the meaning of order, group and display. If you use display, you cannot use descending. However it is simple to have the data ordered anyway: just sort it before proc report comes...
GROUP means a summary. Same like CLASS in PROC MEANS. Each distinct date is one group, so if you have only 4 different dates, that is ok. The other numeric data is summarized according to the selected statistic. ORDER sorts the data and prints only the first occurance of a new date. No statistics are calculated in the rows, only in BREAK-lines.

By the way: if you use ORDER with formatted values, it is necessary to use also ORDER=DATA or ORDER=INTERNAL, otherwise you get it sorted by the formatted values.

Hope that helps a bit.
sarunas
Calcite | Level 5
Thank you, actually the values of date variable are all diferent. Interesting thing, that when I run this programs as stored process on Enterprise Guide all rows are outputed to html output. Here is a focus 🙂

Thank you for you help 🙂

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
  • 8 replies
  • 1157 views
  • 0 likes
  • 3 in conversation