View previous topic :: View next topic
|
Author |
Message |
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
Hi All,
Can you someone please help me with below code:
Code: |
%GLOBAL DATE01 DATE02;
DATA _NULL_ ;
DD = DAY(TODAY());
ED1 = INTNX('MONTH',TODAY(),-1,'E');
ED2 = COMPRESS(PUT(ED1,YYMMDD10.),'-');
CALL SYMPUT ('DATE02',ED2);
PUT 'DD : ' DD ;
PUT 'ED1 : ' ED1 ;
PUT 'ED2 : ' ED2 ;
PUT 'DATE02 : ' &DATE02 ;
RUN ;
|
I am trying to assign the last date of previous month to global variable but DATE02 is not getting populated. No error message.
Best Regards, |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
A macro variable created by SYMPUT will not be available until after this DATA step finishes.
After this step, use this to see the value:
%put DATE02 = &DATE02;
Also, I do not see what GLOBAL is needed for. |
|
Back to top |
|
|
santosh_g
New User
Joined: 14 Aug 2011 Posts: 24 Location: india
|
|
|
|
Hi Phil,
I got my mistake and corrected my code. thank you for your help.
Best Regards, |
|
Back to top |
|
|
|