Free software training Videos

Free software training Videos
https://www.youtube.com/user/VLRTraining

List Of Best WebSites

Friday, 23 November 2012

*cat in as400


The *CAT operator concatenates two character strings

operator symbol is     ||


EXAMPLE1:
  CHGVAR     VAR(&C) VALUE('RAM' *CAT 'ESH')
            output
RAMESH


EAMPLE2;
CHGVAR     VAR(&C) VALUE('RAM   ' *CAT 'ESH')

     OUTPUT
RAM  ESH ( 2 SPACES AFTER RAM)





Example:

0001.00 PGM                                                                 
0002.00              DCL        VAR(&A) TYPE(*CHAR) LEN(10) VALUE('ramesh') 
0003.00              DCL        VAR(&B) TYPE(*CHAR) LEN(10) VALUE('CHANDANA')
0004.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)                 
0005.00              CHGVAR     VAR(&C) VALUE(&a *cat &b)                   
0006.00              SNDUSRMSG  &C                                          
0007.00 ENDPGM  


OutPUT

Job 418467/CHVRAMESH/QPADEV0024 changed by JOBMANAGER.
ramesh    CHANDANA                                                   




_________USING OPERATOR  SYMBOL __________________
0001.00 PGM                                                                 
0002.00              DCL        VAR(&A) TYPE(*CHAR) LEN(10) VALUE('ramesh') 
0003.00              DCL        VAR(&B) TYPE(*CHAR) LEN(10) VALUE('CHANDANA')
0004.00              DCL        VAR(&C) TYPE(*CHAR) LEN(20)                 
0005.00              CHGVAR     VAR(&C) VALUE(&a *cat &b)                   
0006.00              SNDUSRMSG  &C                                          
0007.00              CHGVAR     VAR(&C) VALUE('  RAM   ' || ' ESH ')        
0008.00              SNDUSRMSG  &C                                          
0009.00 ENDPGM                                                                                                         

No comments:

Post a Comment