BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VISHNU239
Obsidian | Level 7

data k;
input name $ sales95 - sales99;
cards;
vandana 876 48 4 562 23
nandu 23 8763 36 3 234
roy 23 3 7863 3 32
john 23 5 7653 3 323
daniel 432 8654 4 234 234
run;

/*1 USD = 67.94 INR*/

/*please help me find the solution for the below question*/

/* keep both dollars and rupees with in a single dataset*/

/*data in the cards are in USD*/

 

/*i converted usd to inr using below code and it worked*/

 

/*how to  keep both dollars and rupees with in a single dataset*/

 

data k;
input name $ sales95 - sales99;
array vishnu(5) sales95-sales99;
do lilly=1 to 5;
vishnu(lilly)= vishnu(lilly)*67.94;
end;
drop lilly;
cards;
vandana 876 48 4 562 23
nandu 23 8763 36 3 234
roy 23 3 7863 3 32
john 23 5 7653 3 323
daniel 432 8654 4 234 234
run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Please post code using {i} or running-man-icon.

 

You will have to create new variables to hold the converted values.

 

data k;
   length Name $ 20 Sales95-Sales99 Rupies95-Rupies99 8;
   input name $ sales95 - sales99;

   array vishnu(5) sales95-sales99;
   array rupies(5) Rupies95-Rupies99;

   do lilly=1 to 5;
      rupies(lilly) = vishnu(lilly) * 67.94;
   end;

   drop lilly;
   cards;
vandana 876 48 4 562 23
nandu 23 8763 36 3 234
roy 23 3 7863 3 32
john 23 5 7653 3 323
daniel 432 8654 4 234 234
;
run;

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

Please post code using {i} or running-man-icon.

 

You will have to create new variables to hold the converted values.

 

data k;
   length Name $ 20 Sales95-Sales99 Rupies95-Rupies99 8;
   input name $ sales95 - sales99;

   array vishnu(5) sales95-sales99;
   array rupies(5) Rupies95-Rupies99;

   do lilly=1 to 5;
      rupies(lilly) = vishnu(lilly) * 67.94;
   end;

   drop lilly;
   cards;
vandana 876 48 4 562 23
nandu 23 8763 36 3 234
roy 23 3 7863 3 32
john 23 5 7653 3 323
daniel 432 8654 4 234 234
;
run;
VISHNU239
Obsidian | Level 7

Thank you andreas_Ids. Got it.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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
  • 2332 views
  • 1 like
  • 2 in conversation