Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SAS - Global variable.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
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    Post subject: SAS - Global variable.
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

Active Member


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

PostPosted: Wed Apr 08, 2015 8:06 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us