sas stored process create new variable sas code
PROC SQL;
CREATE TABLE DATA1 AS
SELECT
t1.HEAD,put(input(t1.HEAD,best4.),z4.) as HEAD1
from data t1
quit;
ods markup file="//report/data.xls" tagset=tagsets.test alias='normal' style=mystyle;
proc report data=data;
run;
excel output not display and columns not display
Use in below code the option to create and populate variable HEAD that fits your data the best.
It's just about applying the right format to the SAS variable so SAS can "tell" Excel how to represent the value.
data class;
set sashelp.class;
Age_c=put(age, 3.);
run;
PROC SQL;
CREATE TABLE DATA1 AS
SELECT
t1.Name,
put(input(t1.Age_c,best4.),z4.) as HEAD1 format=$4.,
input(t1.Age_c,best4.) as HEAD2 format=z4.,
t1.age as HEAD3 format=z4.
from class t1;
quit;
ods excel file="c:\temp\data.xlsx";
proc report data=data1;
run;
ods excel close;
Read the log, or post it here so that we see what's happening actually.
Hell @Daily1
If your intention is to create an excel file, why not use ods excel instead of ods markup?
I am giving an example code approximating your code. Try this and it should work.
data class;
set sashelp.class;
Age_c=put(age, 3.);
run;
PROC SQL;
CREATE TABLE DATA1 AS
SELECT
t1.Name, put(input(t1.Age_c,best4.),z4.) as HEAD1
from class t1;
quit;
ods excel file="/home/theprogmin/data.xlsx" ;
proc report data=data1;
run;
ods excel close;
If this does not work, do post the complete log as text - not as an image or screen shot.
Use in below code the option to create and populate variable HEAD that fits your data the best.
It's just about applying the right format to the SAS variable so SAS can "tell" Excel how to represent the value.
data class;
set sashelp.class;
Age_c=put(age, 3.);
run;
PROC SQL;
CREATE TABLE DATA1 AS
SELECT
t1.Name,
put(input(t1.Age_c,best4.),z4.) as HEAD1 format=$4.,
input(t1.Age_c,best4.) as HEAD2 format=z4.,
t1.age as HEAD3 format=z4.
from class t1;
quit;
ods excel file="c:\temp\data.xlsx";
proc report data=data1;
run;
ods excel close;
English is also not my native language but ... can you please re-formulate what you've trying to say because currently it's all gibberish to me.
First create Stored process this code after excel output not show
data class;
set sashelp.class;
Age_c=put(age, 3.);
run;
PROC SQL;
CREATE TABLE DATA1 AS
SELECT
t1.Name,
put(input(t1.Age_c,best4.),z4.) as HEAD1 format=$4.,
input(t1.Age_c,best4.) as HEAD2 format=z4.,
t1.age as HEAD3 format=z4.
from class t1;
quit;
ods excel file="c:\temp\data.xlsx";
proc report data=data1;
run;
ods excel close;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.