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

Hi Community,

 

I would like to use System Date in my Report Parameter. Is there anyway wherein I can fetch system date.

I've aggregated measures which use this "System Date Parameter" for calculation, From System Date I'll be using the Year and Quarter for their calculation.

 

Regards,

SAS Explorer

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi

 

You can get the current date using this expression:

DatePart( Now() )

This is a date that can be formatted in different ways, or used as part of a filter on date items.

 

Since parameters do not support a date type, you need to format the date as a char, see example below:

Format(DatePart(Now()), 'YYQ6.')

This will return a char string that can then be used as needed.

 

You might also have a look at this SAS Note entry http://support.sas.com/kb/58/046.html

 

Bruno

View solution in original post

5 REPLIES 5
pearsoninst
Pyrite | Level 9
You can use the SYSDATE it is an AMV
BrunoMueller
SAS Super FREQ

Hi

 

You can get the current date using this expression:

DatePart( Now() )

This is a date that can be formatted in different ways, or used as part of a filter on date items.

 

Since parameters do not support a date type, you need to format the date as a char, see example below:

Format(DatePart(Now()), 'YYQ6.')

This will return a char string that can then be used as needed.

 

You might also have a look at this SAS Note entry http://support.sas.com/kb/58/046.html

 

Bruno

SAS_Explorer
Obsidian | Level 7

Hi @BrunoMueller,

 

I've a tried it and its working. Can you tell me how to convert "year(category)" to year as numeric?

 

Regards,

SAS Explorer

BrunoMueller
SAS Super FREQ

Hi

 

Is category a date or a char variable?

 

The YEAR operator expects to have a date as its argument and will return a numeric.

 

Bruno

SAS_Explorer
Obsidian | Level 7

Hi @BrunoMueller,

 

Its a Date variable, I've done by creating a calculated Item as follows:

TreatAs(_Number_, Year(DatePart(Transaction Date))) 

Is there any other method to do it, plz share

 

Regards,

SAS Explorer

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2419 views
  • 0 likes
  • 3 in conversation