Link to home
Start Free TrialLog in
Avatar of JCW2
JCW2

asked on

Form a Substring

In

 rec = row.i                                              
 ij = 19                                                  
 j = 30                                                    
 DO FOREVER                                                
  IF  substr(rec,ij,1) = '0' THEN                          
   ij = ij + 1                                            
  ELSE LEAVE                                              
 END                                                      
                                                           
 DO FOREVER                                                
  IF substr(rec,j,1) = '0' THEN                            
   j = j + 1                                              
  ELSE LEAVE                                              
 END                                                      
                                                           
endi = 0                                                  
endj = 0                                                  
endi = endi + ij                                          
endj = endj + j                                            
                                                           
DO FOREVER                                                
 IF substr(rec,endi,1) = ' ' THEN                          
 LEAVE                                                    
 ELSE endi = endi + 1                                      
END                                                        
                                                           
DO FOREVER                                                
 IF substr(rec,endj,1) = ' ' THEN                          
 LEAVE                                                    
 ELSE endj = endj + 1                                      
END                                                        
                                                           
received = substr(rec,ij,endi)                            
sent     = substr(rec,j,endj)            

,

I try to take certain numbers out of a larger string, trimming zeros on the left, and removing the space and the things to the right of it to compose my strings.

What am I doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JCW2
JCW2

ASKER

tHANK YOU FOR YOUR HELP.