The SAS Output Delivery System and reporting techniques

Formats are lost when using ODSOUT

Reply
Contributor
Posts: 33

Formats are lost when using ODSOUT

Hi everybody,

Have anyone of you had this problem before :

when I use ODSOUT for my tables, i lose all my formats, for examples my percentages are in numx10.1 format but in the final output with ODSOUT this format is lost.

Thanks Smiley Wink

SAS Super FREQ
Posts: 8,744

Formats are lost when using ODSOUT

Hi:

  I'm not entirely sure what you mean by "ODSOUT" -- could you mean the ODS OUTPUT statement? Or, do you have a FILENAME statement that you have named "ODSOUT"?

  Rather than make up an example that might be wrong, could you post your code and possibly describe in a bit more detail what your data looks like? Or, even better use one of the SASHELP files (SASHELP.CLASS, SASHELP.SHOES or SASHELP.CARS) to illustrate the problem.

cynthia

Contributor
Posts: 33

Re: Formats are lost when using ODSOUT

]HI, in fact i was meaning the object oriented program on sas using DATA _NULL_ and DECLARE ODSOUT, finally i've found the source of problem, I am now assigning the format in the _NULL_ DATA STEP so i Have variables formated in the output , but still have a problem, some cells are shifted.

Here are the program, and the output with the problem :

ods listing close;

option nodate nonumber orientation=landscape;

ods rtf path=&ch_res file="T3t.doc" style=rapport  startpage=no bodytitle;

title "Tableau T3. Nombre d'incidents et d'effets indésirables en fonction de la gravité";

DATA _NULL_  ;

        SET table03 END = fin;

        IF _N_ = 1 THEN DO ;

            DECLARE ODSOUT rapport () ;

            rapport.TABLE_START() ;

            rapport.ROW_START(TYPE:"HEADING") ;

                rapport.FORMAT_CELL(TEXT:"Niveau de gravité",ROW_SPAN:3,OVERRIDES:"JUST=LEFT") ;

                rapport.FORMAT_CELL(TEXT:"Total",ROW_SPAN:2) ;

                rapport.FORMAT_CELL(TEXT:"Non graves",COLUMN_SPAN:4) ;

                rapport.FORMAT_CELL(TEXT:"Graves",COLUMN_SPAN:5) ;

            rapport.ROW_END() ;

            rapport.ROW_START() ;

                rapport.FORMAT_CELL(TEXT:"G1",COLUMN_SPAN:2) ;

                rapport.FORMAT_CELL(TEXT:"G2",COLUMN_SPAN:2) ;

                rapport.FORMAT_CELL(TEXT:"G3",COLUMN_SPAN:2) ;

                rapport.FORMAT_CELL(TEXT:"G4",COLUMN_SPAN:2) ;

                rapport.FORMAT_CELL(TEXT:"G5") ;

            rapport.ROW_END();

            rapport.ROW_START() ;

                *rapport.FORMAT_CELL(TEXT:"") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm  ") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"%",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=2cm") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"%",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"%",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"%",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                rapport.FORMAT_CELL(TEXT:"n",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

                *rapport.FORMAT_CELL(TEXT:"%",OVERRIDES:"FONTWEIGHT=BOLD cellwidth=1cm") ;

            rapport.ROW_END();

        END ;

            rapport.ROW_START() ;

                rapport.FORMAT_CELL(TEXTSmiley Tongueut(nat,$effetinc.),OVERRIDES:"JUST=LEFT FONTWEIGHT=MEDIUM ") ;

                rapport.FORMAT_CELL(TEXT:frequency5,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:frequency1,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:compress(put(percent1,numx10.1)),OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:frequency2,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:compress(put(percent2,numx10.1)),OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:frequency3,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:compress(put(percent3,numx10.1)),OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:frequency4,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:compress(put(percent4,numx10.1)),OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                rapport.FORMAT_CELL(TEXT:freqG5,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

                *rapport.FORMAT_CELL(TEXTSmiley TonguectG5,OVERRIDES:"FONTWEIGHT=MEDIUM") ;

            rapport.ROW_END();

        IF fin THEN rapport.TABLE_END() ;

    RUN;

ods rtf close;

ods listing;

title;

                                                                                                                                                                                                                                                                              

Niveau de gravité

 

Total

 

Non    graves

 

Graves

 

G1

 

G2

 

G3

 

G4

 

G5

 

 

n

 

n

 

%

 

n

 

%

 

n

 

%

 

n

 

%

 

n

 

Incidents

 

90

 

15

 

4,3

 

38

 

10,9

 

30

 

8,6

 

7

 

2,0

 

0

 

Effets indésirables

 

259

 

6

 

1,7

 

16

 

4,6

 

173

 

49,6

 

64

 

18,3

 

0

 

Total

 

349

 

21

 

6,0

 

54

 

15,5

 

203

 

58,2

 

71

 

20,3

 

0

 

Attachment
SAS Super FREQ
Posts: 8,744

Formats are lost when using ODSOUT

Hi:

  You might want to work with Tech Support on this question. using the object language for DATA _NULL_ is still a pre-production feature of SAS. So it's hard to figure out what is going on and whether it is something that needs to be fixed in upcoming versions or whether it is your code that is causing the shift.

cynthia

Contributor
Posts: 33

Re: Formats are lost when using ODSOUT

I think there is something in my code that i really don't see, i have just began working with this kind of programming , it works with other tables but not for this one Smiley Sad

What is tech support, how can i contact them ?? thanks

Super Contributor
Posts: 1,636

Re: Formats are lost when using ODSOUT

Hi,

you can email sas at support@sas.com or call them 919-677-8008.

Good luck and Merry Christmas!

Contributor
Posts: 33

Re: Formats are lost when using ODSOUT

thanks a lot Linlin and for you Cynthia

Ask a Question
Discussion stats
  • 6 replies
  • 304 views
  • 6 likes
  • 3 in conversation