Solved

Sas Date (Month)

Posted on 2011-02-17
1
526 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
1 Comment
 
LVL 11

Accepted Solution

by:
theartfuldazzler earned 500 total points
Comment Utility
Hi

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


D
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
This article describes some very basic things about SQL Server filegroups.
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…

743 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now