IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SAS - Global variable.


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Tue Apr 07, 2015 2:05 am
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1016
Location: Richmond, Virginia

PostPosted: Wed Apr 08, 2015 8:06 am
Reply with quote

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
View user's profile Send private message
santosh_g

New User


Joined: 14 Aug 2011
Posts: 24
Location: india

PostPosted: Wed Apr 08, 2015 8:58 am
Reply with quote

Hi Phil,

I got my mistake and corrected my code. thank you for your help.

Best Regards,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts DECIMAL HOST VARIABLE OR PARAMETER 14... DB2 6
No new posts FILE STATUS - 39 ON VARIABLE LENGTH V... COBOL Programming 2
No new posts Unable to display comp variable COBOL Programming 4
No new posts IWS/TWS build dinamic or variable APp... IBM Tools 0
No new posts Determine what library member is in, ... JCL & VSAM 9
Search our Forums:

Back to Top