Hi
I want to output "Y" if FIN_CD equals "1S". If there's any other variable other than 1S then I do not want to output them. I'm not sure if I'm able to do this in the WHERE statement or if I need a data step.
Here is some sample code:
PROC SQL;
create table automation_exception as
SELECT
TRANSACTION_FACT.TRN_CD as FIN_CD, FROM RDWP0.TRANSACTION_FACT, RDWP0.TRANSACTION_CD_LOOKUP, WHERE (TRANSACTION_CD_LOOKUP.TRN_CD=TRANSACTION_FACT.TRN_CD) AND (ACCT_DIM.ACCT_ID=TRANSACTION_FACT.ACCT_ID);
QUIT;
Hi.
Could it be as simple as the following?
SELECT
case when TRANSACTION_FACT.TRN_CD eq '1S' then '1S' else 'N' end as FIN_CD,
Daniel Santos @ www.cgd.pt
@jmoore168 wrote:
Hi
I want to output "Y" if FIN_CD equals "1S". If there's any other variable other than 1S then I do not want to output them. I'm not sure if I'm able to do this in the WHERE statement or if I need a data step.
Did you mean if FIN_CD is not equal to '1S' you don't want them in the output at all? If so subset the data as early as practical:
FROM
(select * from RDWP0.TRANSACTION_FACT where TRN_CD = '1S') ,
RDWP0.TRANSACTION_CD_LOOKUP,
will only select the records of interest before combining with the other data set.
Hi.
Could it be as simple as the following?
SELECT
case when TRANSACTION_FACT.TRN_CD eq '1S' then '1S' else 'N' end as FIN_CD,
Daniel Santos @ www.cgd.pt
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.