BookmarkSubscribeRSS Feed
mary_2017
Calcite | Level 5
data pepito;
format dt_pepito DDMMYY10.;
input dt_pepito DDMMYY10.;
if DT_SS ne ' ' and DT_SENT ne ' ' then DT_SENT as DT_PEPITO;
if DT_SS ne ' ' and DT_SENT = ''  then DT_SENT as DT_PEPITO;
if DT_SS eq ' ' and DT_SENT ne ' ' then DT_SENT as DT_PEPITO;
else 'review';
set pepito2;
run;

Hello everyone, 

 

I have import the file with DT_SS and DT_Sent and I''m trying to create DT_PEPITO.

DT_SS AS DDMMYY10.

DT_SENT AS DDMMYY10.

 

Could someone help me, please?


pepito.png

 

And SAS give me errors that I don't know how to solve it.

ERROR 180-322: Statement is not valid or it is used out of proper order.

ERROR: Variable dt_envio has been defined as both character and numeric.

 

2 REPLIES 2
novinosrin
Tourmaline | Level 20

Hello @mary_2017  Welcome to SAS communities. 

 

First off,

 

1. What do you mean by import file i.e do you have raw external file that you need to import? If yes, what kind of file it is? Is it a delimited txt file or is it an excel or something else.

 

2. Once you import, i.e that is converted your raw external file to a SAS dataset form, what is that you are trying to accomplish, meaning logic?

 

3. Please do not paste pictures of your sample as lazy people like me wouldn't bother to create a sample by typing letter by letter or word by word and then write a code and test it for you. So please post as plain text that we can copy/paste

 

4. Post a clean sample of what you HAVE, what you WANT and logic to get the WANT. 

 

That's all we ask. Cheers!

Jagadishkatam
Amethyst | Level 16

Please try

 

data pepito;
set pepito2;
DT_PEPITO=coalesce(DT_SS,DT_SENT);
format DT_PEPITO date9.; run;
Thanks,
Jag

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 756 views
  • 0 likes
  • 3 in conversation