BookmarkSubscribeRSS Feed
epimph69
Calcite | Level 5

Hi everyone ,

  In my variable LOLITA ,I have this table , I have already programed blabla and blibli and I have also created one var corresponding a,b,c,d,.... and I called it ALFA. Without using macro sas , I need use IF,THEN ,ANd,ELSE so my question is what do I do  if´BLABLA=1 then alfa=a and for b, c ?

                    Blabla

                        Blibli

1

2

3

1

2

3

a

b

c

d

e

f

thx

1 REPLY 1
Amir
PROC Star

Hi,

The structure of your data is not clear to me. Perhaps you could show us the data step used to create your data so we can run it and show us a table of results that you want.

When using a character data value, the value should be in quotes, e.g.:

if blabla=1 then alfa='a';

For more information on the if statement, see:

SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

If you have tried some code which is not working then post the code and the log showing the error.

Regards,

Amir.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 703 views
  • 0 likes
  • 2 in conversation