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 Requirement - remove the trailing ‘{‘ from a variabl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
venktv

New User


Joined: 29 Mar 2006
Posts: 59
Location: Montreal

PostPosted: Mon Sep 08, 2008 1:57 pm    Post subject: SAS Requirement - remove the trailing ‘{‘ from a variabl
Reply with quote

Hi Friends,

The requirement is to remove the trailing ‘{‘ from a variable using SAS code.

For eg.:

If Var1 is ‘ABC}}}}}}}}}’ then only ‘ABC’ should be retained
If Var1 is ‘ABC}}}}}}}XYX’ then ‘ABC}}}}}}}XYX’ should be the output
If Var1 is ‘ABC}}}}}}}XYX}}}}}}}}}’ then ‘ABC}}}}}}}XYX’ should be the output
If Var1 is ‘}}}}}}}}}}’ then the output should be null


Can you pls help me to write a logic in SAS language

Thanks
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7932
Location: Bellevue, IA

PostPosted: Mon Sep 08, 2008 5:08 pm    Post subject:
Reply with quote

The easiest way i can think of is
Code:
var1rev = reverse(var1) ;
do while (substr(var1rev,1,1) = '}');
   var1rev = substr(var1rev, 2) ;
end;
var1 = reverse(var1rev);
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Cards mainframe developer requirement... capricorn Mainframe Jobs 0 Sun Sep 11, 2016 9:57 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
This topic is locked: you cannot edit posts or make replies. Urgent Requirement in CTS Chennai. Mahi_e Mainframe Jobs 0 Wed Feb 17, 2016 3:52 pm
No new posts Remove header only knobi SYNCSORT 5 Mon Feb 15, 2016 10:42 pm


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