BookmarkSubscribeRSS Feed
athak_bharadwaj
Calcite | Level 5

Hi,

I am using SAS EG for my project. I have written following code to resolve week value which is working fine in SAS 9.1. But it is not working in SAS EG. Please help with you suggestions.

data dummy2;

  set outdata.&fiscal_map.;

  if start_dt le '22Dec2014'd and '22Dec2014'd le end_dt then do;

  call symput('week_start', week_no);

   end;

run;

%put &week_start;

Appreciate your help.

Thanks

2 REPLIES 2
gergely_batho
SAS Employee

Your code should work in EG too.

What warning or error messages do you get?

Make sure, your if condition is satisfied. Put a  putlog 'CONDITION IS TRUE';  statement above call symput. Do you see this 'CONDITION IS TRUE' message in the log?

ballardw
Super User

Please describe what "not working" means. Error? Unexpected value? No output/ blank value but no error?

It is possible that you expect one value but more than one record satisfies your if condition. You would get the value associated with the LAST record where the condition is true.

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1286 views
  • 0 likes
  • 3 in conversation