Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sas Date (Month)

Posted on 2011-02-17
1
Medium Priority
?
536 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 2000 total points
ID: 34915734
Hi

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


D
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses

885 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