Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Make 13 dates

Posted on 2012-08-31
5
Medium Priority
?
256 Views
Last Modified: 2012-09-10
Hi,

The following macro will not work.

%MACRO LOOPING;                        
    %do i = 1 %to 13 ;
        %global d13_&i ;
        %let d13_&i = %sysfunc(intnx('month',&strtjr,1)) ;
    %end ;
%MEND;
%LOOPING;

&strtjr = 18993

What's wrong?

Tx
0
Comment
Question by:sonmic
  • 3
  • 2
5 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38353988
It looks like you are making all the dates the same date; is that the intent? Is &strtjr = 18993 a line of code after the loop or is it just there so we know what it was in the loop? If it's actually setting the value, it certainly should happen first.
0
 

Author Comment

by:sonmic
ID: 38354110
No. What i want is 13JAN2012, 13FEB2012, ............13JAN2013.
0
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 38354170
Okay. On the %let line, change the 1 to either i or i-1, whichever gives you want you want.
0
 

Author Comment

by:sonmic
ID: 38354230
I get the following error message :

ERROR: Argument 3 to function INTNX referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number.
ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list.  Execution of %SYSCALL statement or %SYSFUNC or
       %QSYSFUNC function reference is terminated.
0
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 1500 total points
ID: 38354324
Sorry. I'm not really a SAS programmer. Do you need to do &i or something? The idea is that you need to use the value of i (which is ranging from 1 to 13) there where you had the 1.

From what I can see, I would guess that you do need the & in front of the i on the %let line.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

577 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