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: 1042
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top