BookmarkSubscribeRSS Feed
RussellAlmeida
Calcite | Level 5
Hi,

OS : AIX
SAS Version: SAS 9.1.3

Simply said why can't I have a Norwegian sorting on my addresses. ( Æ-Ø-Å)



proc sort NORWEGIAN data = VL0608_467R_Address_distr_lst
(where =
(Postal_code_cd ge &From_Postal_Code. and
Postal_code_cd le &To_Postal_Code.))
out = VL0608_467R_Address_distr_lst1;
by Report_Name Report_Id Title_Line2 Sort_Variable Address_List;
run;
--------------------------------------------------------------------------------------------------------------
But I seems not to be able to put it here too.


proc report data = VL0608_467R_Address_distr_lst1
nowd
spacing = 30
wrap ls=100
split='*'
style(header)={background=white}
style(report)={rules=none frame=void cellspacing=0 borderwidth=0}
style(summary)={background=graycc} split='*';

BY Report_Name Report_Id Title_Line2;

columns
Report_Name
Report_Id
Sort_Variable

Address_list
Organization_id
Organization_Nm
Rack_Id
Sort_Variable
Postal_Code_Cd
_Postal_Code_Cd;


define Report_ID/group noprint;
define Report_name/group noprint;
define Sort_Variable/order noprint;
define Postal_Code_Cd/noprint;


define Address_list/left flow "GATE/VEI/STED" spacing=20
style(column)=[cellwidth=380pt font=(Arial, 6pt) just = left] flow
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;

define Organization_Nm/left flow " "
style(column)=[cellwidth=10pt font=(Arial, 6pt) just = left] flow
style(header)= [cellwidth=10pt font_weight=bold font=(Arial, 6pt) just = left] flow;

define Organization_id/left flow 'ENHET' spacing = 10
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = left] flow
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;

define Rack_Id/left 'REOLNR' spacing = 10 format = z4.
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = left] flow
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;

define _Postal_code_cd/left 'POSTNR' spacing = 10
style(column)=[cellwidth=50pt font=(Arial, 6pt) just = left] flow
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;
break after Sort_Variable/skip ol suppress;

compute after Sort_Variable;
line ' ';
endcomp;
run;


Thkx for any help,
Regards,

Rachid ( beginner working with Russell )
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
I'm not clear. Are you saying the the PROC SORT doesn't work with the NORWEGIAN option??? Or that PROC REPORT doesn't honor the sorted data???

If the PROC SORT doesn't work with the documented NORWEGIAN option:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000146878.htm#a003210225
then you have an issue for Tech Support.

If PROC REPORT is not HONORING the sort order of the data (when you use the data in a PROC REPORT step), then you might try:

1) Sort with the NORWEGIAN option (with PROC SORT)
2) Use ORDER=DATA in the PROC REPORT step to tell PROC REPORT to honor whatever order the data are in. PROC REPORT does not have a NORWEGIAN option, but IF your NORWEGIAN option is working on the SORT step, then ORDER=DATA should make PROC REPORT respect that order:
[pre]
define Report_ID/group noprint order=data;
define Report_name/group noprint order=data;
define Sort_Variable/order noprint order=data;
[/pre]
Add ORDER+DATA to all your group and/or ORDER variables.

Then, since you are working with Russell and since Russell works with ODS PDF and with stored processes, there are some additional issues in your code:
[pre]
define Address_list/left flow "GATE/VEI/STED" spacing=20
style(column)=[cellwidth=380pt font=(Arial, 6pt) just = left] flow
style(header)= [font_weight=bold font=(Arial, 6pt) just = left] flow;

define Organization_Nm/left flow " "
style(column)=[cellwidth=10pt font=(Arial, 6pt) just = left] flow
style(header)= [cellwidth=10pt font_weight=bold font=(Arial, 6pt) just = left] flow;
[/pre]

The FLOW option is a LISTING only option and will not work for ODS output, such as that returned by stored processes or sent to ODS HTML, ODS RTF or ODS PDF destinations. You should code an explicit CELLWIDTH style= override for each of these statements where you are currently using FLOW.

In addition, SPACING, LS, and WRAP wrap options, either in the PROC REPORT statement or SPACING in the DEFINE statement -- are also LISTING only options and are basically ignored by ODS destinations other than listing -- which would include all types of stored process output.

For more information about PROC REPORT options that are LISTING only options (like PANEL, HEADLINE, HEADSKIP, OL, DOL, etc), refer to these sites:
http://support.sas.com/kb/2/549.html
http://support.sas.com/rnd/base/ods/templateFAQ/report1.html (shows some workarounds that use CSS techniques to simulate some of the options for HTML destinations)

cynthia
RussellAlmeida
Calcite | Level 5
Hi,

Thks your first lines solved the problem.

Regards, Rachid + Russell 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 800 views
  • 0 likes
  • 2 in conversation