The SAS Output Delivery System and reporting techniques

Norwegian sort

Reply
Contributor
Posts: 33

Norwegian sort

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 )
SAS Super FREQ
Posts: 8,866

Re: Norwegian sort

Posted in reply to RussellAlmeida
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
Contributor
Posts: 33

Re: Norwegian sort

Posted in reply to RussellAlmeida
Hi,

Thks your first lines solved the problem.

Regards, Rachid + Russell :-)
Ask a Question
Discussion stats
  • 2 replies
  • 137 views
  • 0 likes
  • 2 in conversation