Hi folks,
I am attempting to read an xlsx file into SAS without SAS doing anything to modify the the variable types or the characters as they appear when viewing the xlsx file in Excel. In other words, if something looks like a date, regardless of how it's stored in the xlsx file (e.g., "11/25/2023"), it'll show up in sas as a character variable as that same value (e.g., "11/25/2023"). In other words, I'd like to replicate what the Import Data wizard in SAS does when it just defines all fields as character, as in the following attributes for one particular column, for example:
type=String
Source Informat=$CHAR29
Len.=29
Output Format=$CHAR29.
Output Informat=$CHAR29.
The code automatically generated from the Import Data wizard when I do this contains the DATALINES4 statement, which I can't use because I can't just fill all of these in, as I'm trying to load the data in without having to look at the contents. I'd be fine, though, if I can define the variable types/lengths/formats/etc., as I know what the variables are and what they'll be named.
How do I do this without having to fill in the DATALINES4 content?
I need to be able to specify the sheet within the Excel workbook in question as well.
Thanks!
... View more
Good morning.
I'm hoping some can help because I'm out of ideas.
I'm attempting to use ODS Excel to place the page number and number of pages in the footer at a right justify. I've tried the three different methods in the example below. I've done some searching and found some information but can't seem to get it to work.
I get warning messages such as:
WARNING: Apparent symbolic reference R not resolved. WARNING: Apparent symbolic reference P not resolved. WARNING: Apparent symbolic reference N not resolved.
Can anyone give me a hint as to what I may be doing wrong here?
options(sheet_interval = 'none'
sheet_name = 'Sheet Name'
frozen_headers = '2'
row_repeat = '1-2'
suppress_bylines = 'yes'
autofilter = 'all'
pages_fitwidth = '1'
pages_fitheight = '50'
/* print_footer = '&R &P & of &N'*/
/* print_footer = 'Page &P & of &N'*/
print_footer = "Page &R &P of &N"
/* print_footer = "&;LInstitutional Research and Assessment &R Page &P of &N &Z &F"*/
absolute_column_width = '12, 30, 30, 18, 10, 10, 12, 50');
... View more
Hello, I want to create just Xbar chart for LOS(hours) quartely with 8 subgroups using SAS.,
I used XSCHART , it will give me both both X-bar and S charts together. Same for XR chart.
but I only want to have X-bar chart.
I also cannot use only xchart in my SAS code as xchart is used for individual data not for subgroup data.
How can I adjust my SAS code to see only the X-bar chart in my output?
proc shewhart data=MIS; xSchart LOS*AdmitYYQ / Markers outtable=outtable ; run;
Attached is the output to see both are in the same frame.
Thanks
... View more
Proc export giving additional quotes to the quoted char values.and if u use data step for that it is giving a space or . To numeric values which is not required . Needs to change nothing.now it is , , but want ,, no space no .for missing numeric value.
... View more
Good day everyone, New EG user here. I am working with a legacy program that looks for lab errors. The numeric errors are assigned a number that represents a letter code. Error #14 has been changed at the lab into 14A and 14B, which results in log notes stating "Invalid numeric data, "14A", at line 115 column 78. How can I edit the code to prevent this? ****import parameter files***; %macro newdata (outfile, filename,param,param_g,param_error, param_a); data first; %let _EFIERR_ = 0; /* set the ERROR detection macro variable */ infile &filename delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=1 ; informat year best32. ; informat month best32. ; informat day best32. ; informat labid best32. ; informat ¶m_g $2. ; informat ¶m best32. ; informat ¶m_error best32. ; informat ¶m_a $2. ; *informat labsignoff $3. ; format year best12. ; format month best12. ; format day best12. ; format labid best12. ; format ¶m_g $2. ; format ¶m 7.3 ; format ¶m_error best12. ; format ¶m_a $2. ; *format labsignoff $3. ; input year month day labid ¶m_g $ ¶m ¶m_error ¶m_a $ ;*labsignoff $ ; if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */ run; proc sort; by labid year month day; data &outfile; set first; if ¶m_error = 0 then do; ¶m_A = "";end; if ¶m_error = 23 then do; ¶m_A = "QQ";end; if ¶m_error = 1 then do; ¶m_A = "A"; ¶m = .; end; if ¶m_error = 22 then do; ¶m_A = "JJ";end; if ¶m_error = 18 then do; ¶m_A = "RR";end; if ¶m_error = 6 then do; ¶m_A = "RR";end; if ¶m_error = 9 then do; ¶m_A = "V";¶m = .;end; if ¶m_error = '14A' then do; ¶m_A = "FF";end; if ¶m_error = '14B' then do; ¶m_A = "V"; end; *proc print; %mend; Thanks for considering this puzzle.
... View more