Alphanumeric / Character Data type in RPGLE Free Format - IBM i / AS400

How to declare character data type in RPGLE free format:-






**Free                                                              
                                                                    
*            Conversation of Alphanumeric data type in free format   
                                                                    
*    D FirstName       S             30A                            
                                                                    
     Dcl-S FirstName    char(30);                                   
                                                                    
*    D Email           S             30A    Varying                 
                                                                    
     Dcl-S Email varchar(30);                                       
                                                                    
*    D LastName        S                    Like(FirstName)         
                                                                    
     Dcl-S LastName Like(FirstName);                                
                                                                    
     Dcl-s Length zoned(4);                                         
                                                                    
*    Displaying Output       
                                                        
      FirstName = 'Amit';                               
                                                        
      Email = 'techsharmit@gmail.com';                  
                                                        
      LastName  = 'Sharma';                             
                                                        
      Dsply FirstName;                                  
                                                        
      Dsply Email;                                      
                                                        
      Dsply LastName;                                   
                                                        
      Length = %len(email);                             
                                                        
      dsply Length;                                     
                                                        
                                                        
      Length = %len(FirstName);              

                            
      dsply Length;            
                            
                            
      *inlr = *on;                    
                                                 

Subscribe Tech Sharmit for more videos on IBMi / AS400

Please refer to the below video for the same topic.                 

                                      


Comments

Popular posts from this blog

Dynamic XMl file creation in IFS using RPGLE Program - IBMI / AS400

Compile Time Data Array in RPGLE - IBM i / AS400

Numeric Data type in RPGLE free format - IBM i / AS400