SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

I would like to assign a percent format for my data in call define.

When I use the statement: call define(_col_,'format','percent8.2') I have all time the error that my server is deconnected.

I joined my input data.

The code is:

ods noresults;
	ods excel file="&Rep_Travail.\&DatePubli._&fichier_final." options(sheet_name='Stats_LinkedIn_Twitter');

	proc report data=donnee_marketing_&numtab noheader nowd style(column)=[textalign=left verticalalign=top];
		columns

			%do i=1 %to &nombre_var;
				VAR&i.
			%end;
		;

		
		compute VAR7;

			if anydigit(VAR1) then
				do;
					call define(_col_,'format','percent8.2');
				end;
		endcomp;

		compute VAR2;

			if anydigit(VAR1) then
				do;
					call define(_col_,'url',VAR2 );
					call define(_col_,'style','style={textdecoration=underline color=blue}');
				end;
			else
				do;
					call define(_ROW_, "style", "STYLE=[BACKGROUND=#00acee font_size = 11pt font_face = 'Arial' font_weight = bold color=white ]");
				end;
		endcomp;
	run;

	ods excel close;
1 REPLY 1
Shmuel
Garnet | Level 18

As you export the output to excel you should change the cells' format in excel itself.

II don't know if it can be done in sas.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 836 views
  • 0 likes
  • 2 in conversation