BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LAtwood
Calcite | Level 5

Hello,

I have a query that selects a single day's data using the macro &date.


Create table work.temptpc

select t1.cc, t1.turn_dt, t1.delay_hrs

from imcs.pay_tpc_prd_a t1

where turn_date = "&date"d

My question is I now would like the query to also grab (filter) our fiscal year data from imcs.pay_tpc_prd_a from the date selected using macro &date.  Our fiscal year is April 1 - March 31.

Example:  If the date selected was September 1, 2013, the fiscal year would be April 1, 2013 - March 31, 2014.

Thanks for your help in advance,

Lori

1 ACCEPTED SOLUTION

Accepted Solutions
SteveNZ
Obsidian | Level 7

Hiya,

Create the following macros using your &date one to subset:

data _null_ ;
   call symput('fstart',intnx('year.4',&date,0,'b')) ;
   call symput('fend',intnx('year.4',&date,1,'b')-1) ;

    run ;

cheers

Steve

View solution in original post

1 REPLY 1
SteveNZ
Obsidian | Level 7

Hiya,

Create the following macros using your &date one to subset:

data _null_ ;
   call symput('fstart',intnx('year.4',&date,0,'b')) ;
   call symput('fend',intnx('year.4',&date,1,'b')-1) ;

    run ;

cheers

Steve

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
  • 1 reply
  • 890 views
  • 1 like
  • 2 in conversation