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;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.