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
Hello
I have a string that have 3 words with two commas between them.
I want to calculated 3 fields- continent, city,country.
Can anyone explain why City=scan(X,-2,","); result with city?
In this case there are 2 commas, to which comma this code refer to? to first or second?
As I understand since -2 is negative then it search for the word in right side of the comma?
data have;
input X $20.;
cards;
EU,Athens,Greece
Asia,Beijing,China
;
run;
data want;
set have;
continent=scan(X,1,",");/**EU**/
City=scan(X,-2,",");/**Athens**/
Country=scan(X,-1,",");/**Greece**/
Run;
... View more
Hi everyone,
I’ve used PROC CAUSALGRAPH to identify a valid adjustment set of variables to include in my model (which will use inverse probability weighting).
In the SAS documentation, and specifically the example “Causal Model of the Effect of Persistent Perfluoroalkyl Substances on Breastfeeding Duration”, data on six variables are available: Age, BMI, Education, Employment, Parity, and PrevBF.
PROC CAUSALGRAPH recommends the following valid adjustment set of 4 variables: Education, Employment, Parity, and PrevBF.
Note, Age and BMI are not included in this adjustment set.
I understand the reasoning behind this, but my question is, if I plan to run inverse probability weighting, using PROC CAUSALTRT, these are the 4 variables I will be included in both PSMODEL and MODEL statements…. and in the output, I’ll get unweighted and weighted values which I will then include in a Table in my report.
Staying with the same example from the SAS documentation, if I do this, then I won’t have an unweighted and weighted value for age and BMI, so what do I do when reporting this in the table?
Any help/comments would be greatly appreciated,
Thank you,
... View more
I am using proc transpose to change the table from wide to long. But in the column "old-column" the old some variable names are truncated. What can I do, to get them in the original length?
proc transpose data=have
name =old_column
out=want
by column_to_keep;
run;
Thanks,
Markus
... View more
Hi experts,
I'm using LEI (Visual Investigator 10.8)
I configured a relationship between entity X and Y.
I would like that this relationship will be created after a task will be approved by a user (assumed that I have a workflow that after an action in it, the relationship will take place...).
It is possible to do that. I didn't get any information regarding this in the documantation.
The below demonstrate it better:
1. A relationship between X and Y has defined.
2. Workflow on entity X was defined.
3. a user create a relationship between record in entity X and record Y. The relationship between them yet not approved (and not visible in Network diagram / bridge table etc...)
4. workflow task on entity X is being made.
5. after a specific task action completed - the relationship will be shown at the Network diagram.
Something like this is possible?
Thanks in advance.
Idan
... View more