Hi,I would appreciate your help. Here's what I am trying to do. I have a dataset that tells me customerID, contact date, order date. I want to find out how many times on average customers have been contacted before they place order.
Right now, I have my code as
data contact1; set contact...
Hi, I am encounter the problem while trying to read this fixed format data into SAS dataset.
The raw data is large about 85 million records total and the layout I was given was
Field Length
ID 8
date 9
amount 12
Source 14
The code I am...
Hi, I am having a problem importing the data from a fixed format text file. The total width of the records is 2309 characters. The owner of the text file said the data is one row per record ID. However, when I open the data to look in Notepad, it seems that the data is 3 rows per ID. I am...
Hi there,
I am trying to create a new variable base on a combination of the characters in an existing value. For example, Var1 has a value "ABCDEFG" and I would like to create a Var2 which should look like "ABC__F".
I tried substring(ltrim(rtrim(Var1,1,3))) to get "ABC" part. However, I don't...
Hi,
I got another error. I basically did not do select all variables(*) in the second query of the union so the error message said
"ORDER BY items must appear in the select list if the statement contains a UNION operator."
Basically, this is what I have.
SELECT A, B, C
FROM mail
left...
Thank you.
However, one more question regarding this. When I UNION this query to another one, I got an error message saying "Error Near Order". Could you please help? Thank you.
(SELECT *
FROM mail
left outer join Orders
on mail.ID=OrdersID
WHERE
and Orders IS NOT NULL
)
UNION...
hmm... it still doesn return anything. Maybe my query is wrong. Let me explain into more detail. Basically, I have 2 files, one has all records that I mailed to and another has only people that responded. I want to join the 2 table but select only people that did not respond. How do I do...
Hi there,
I was trying to select Not NULL record from below query but it did not return anything. Could anyone please help? Basically, I want to get only records the people that did not order.
Thank you so much.
SELECT result1.*
FROM
(SELECT tbl1.Mail, tbl2.Order
FROM tbl1
left outer...
Hi there,
Is there any easy way that I could get all columns data type for my output instead of me having to go through each variable and look at them one by one? I'm looking for something similar to
Proc contents in SAS.
Thank you
I'm trying to create a new variable base on existing variable, BuyerID, using case-when statement. However, the query I have doesn't work. Could anyone please help? Part of the query and error message are below.
*************************
case
when BuyerID='Null' then 1
else 0
end
as...
Can anyone help?
I would like to group the records by the variable I created from case when statement but I got an error saying that that new variable is not part of the table. For example, this is what I have.
Select A, B, C,
case when A=1 then 'Y' else 'N' end as Flag
from Client_table...
Could anyone tell me what is the sql syntax that gives me a similar result as Trim in excel? Basically, I have the data that has space in the middle and I want to get rid of that space. e.g. 111 111 111 and I want to get rid of spaces between the ones.
Thank you
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.