BookmarkSubscribeRSS Feed
kmel56
Calcite | Level 5

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

6 REPLIES 6
Cynthia_sas
SAS Super FREQ

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

kmel56
Calcite | Level 5

]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(TEXT:put(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(TEXT:pctG5,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

 

Cynthia_sas
SAS Super FREQ

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

kmel56
Calcite | Level 5

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

Linlin
Lapis Lazuli | Level 10

Hi,

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

Good luck and Merry Christmas!

kmel56
Calcite | Level 5

thanks a lot Linlin and for you Cynthia

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
  • 6 replies
  • 951 views
  • 6 likes
  • 3 in conversation