Solved

Sas Date (Month)

Posted on 2011-02-17
1
532 Views
Last Modified: 2013-11-16
Hi,

In the code below i separate the month from a date. The result is 12 and OK.
How can i put i in one instruction.

Tx
DATA _NULL_ ;
    %LET datInt   = 31DEC2011 ;
RUN ;
DATA _NULL_ ;
    %LET date   = %SYSFUNC(INPUTN(&datInt,DATE9.)) ;
    %LET datnr  = %SYSFUNC(PUTN(&date,YYMMDD10.)) ;
    %LET maand  = %SCAN(&datnr.,2,-) ;
RUN ;

Open in new window

0
Comment
Question by:sonmic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 total points
ID: 34915734
Hi

%let maand = %SYSFUNC(MONTH("&datint"d));


D
0

Featured Post

Webinar: Security & Encryption in the MySQL world

Join Percona’s Solutions Engineer, Dimitri Vanoverbeke as he presents “Security and Encryption in the MySQL world” on Thursday, July 6, 2017 at 7:00 am PDT / 10:00 am EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question