BookmarkSubscribeRSS Feed
SudheerAnkem
Calcite | Level 5

what is the result of the below statment, if the &beg_date = '20160101'

 

from_date = INPUT (&beg_date, YYMMDD8.);

 

 

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

The result is the string:

from_date = INPUT ('20160101', YYMMDD8.);

 

Gets fed into the SAS compiler.  I assume you know what the input() function does - i.e. convert text in the given format to numeric variant?

LinusH
Tourmaline | Level 20

IMO these kind of questions shouldn't be asked here, since they can be answered by just testing the code.

Data never sleeps
Ksharp
Super User
from_date = INPUTN (&beg_date, YYMMDD8.);
Ksharp
Super User

 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 51         
 52         %let beg_date = '20160101';
 53         data _null_;
 54         from_date = INPUT(&beg_date, YYMMDD8.);
 55         put from_date= yymmddn8.;
 56         run;
 
 from_date=20160101
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.02 seconds
       
 
 57         
 58         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68         

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
  • 4 replies
  • 892 views
  • 2 likes
  • 4 in conversation