MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Remove trailing spaces in Easytrieve

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue May 15, 2007 2:29 am    Post subject: Remove trailing spaces in Easytrieve Reply with quote

Hi

I am concatenating two strings, each is of 50 char length. This will be reported in the header of a report.

String 1 has "Reassessment of UIT "
String 2 has "USA analysis report "

How do you remove the trailing spaces in the string after concatenating and finally have the text center aligned in the header. This should be done in Easytrieve. Can anybody please help me.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue May 15, 2007 7:48 am    Post subject: Reply with quote

psmadhusudhan,

Please use a descriptive title to explain your problem, instead of a generic title. I have changed the title. Try this untested easytrieve solution. This combines both strings into a single string trimming the trailing spaces. If you are writing a report in easytrieve the title is automatically aligned to the center unless you override it.


Code:

                                                     
 DEFINE W-INP-STRING1              W 050 A             
 DEFINE W-INP-STRING2              W 050 A             
                                                       
 DEFINE W-OUT-STRING               W 100 A             
 DEFINE   W-OUT-STR W-OUT-STRING     001 A OCCURS 50   
                                                       
 DEFINE W-STRING                   W 050 A             
 DEFINE   W-STR     W-STRING         001 A OCCURS 50   
                                                       
 DEFINE I-SUB                      W 002 B 0           
 DEFINE O-SUB                      W 002 B 0           
 DEFINE S-CHAR-FOUND               W 001 A             
                                                       
 JOB INPUT NULL                                       
                                                       
   W-INP-STRING1     = 'REASSESSMENT OF UIT'           
   W-STRING          = W-INP-STRING1                   
   PERFORM STRIP-BLANKS                               
   O-SUB             = I-SUB + 2                       
   MOVE W-STR(1) (I-SUB)   TO W-OUT-STR (1) (O-SUB)   
                                                       
   W-STRING          = ' '                             
   W-INP-STRING2     = 'USA ANALYSIS REPORT'           
   W-STRING          = W-INP-STRING2                   
   PERFORM STRIP-BLANKS                               
   MOVE W-STR(1) (I-SUB)   TO W-OUT-STR (O-SUB) (I-SUB)
   STOP                                               
                                                       
 STRIP-BLANKS. PROC                             
                                               
      I-SUB          = 50                       
      S-CHAR-FOUND   = 'N'                     
                                               
      DO UNTIL I-SUB EQ 0 OR S-CHAR-FOUND = 'Y'
         IF W-STR(I-SUB) > ' '                 
            S-CHAR-FOUND = 'Y'                 
         ELSE                                   
            I-SUB   = I-SUB - 1                 
         END-IF                                 
      END-DO                                   
                                               
 END-PROC                                       
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
psmadhusudhan
Beginner


Joined: 28 Nov 2006
Posts: 143
Topics: 48

PostPosted: Tue May 15, 2007 8:50 am    Post subject: Reply with quote

Thanks kolusu. I will try to use descriptive titles from now onwards.
_________________
Thanks
Madhu Sudhan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group