Ü  CAT (Concatenate Two Strings)

·         The CAT operation concatenates the string specified in factor 2 to the end of the string specified in factor- 1 and places it in the result field.

·         Factor-2 must contain a string, and may contain the number of blanks to be inserted between the concatenated strings.

·         A ‘P’ operation extender indicates that the result field should be padded on the right with blanks after the concatenation occurs if the result field is longer than the result of the operation. If padding is not specified, only the leftmost part of the field is affected.

 

Factor 1

OpCode

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

string 1

CAT (P)

string 2 :No. of blanks

concatenated string

 

 

 

 

Example


Columns . . . :    6  80              Browse                                  AMINEM/QRPGLESRC
SEU==>                                                                                 OP_CAT
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 Dfirst_name       s              5    inz(*blanks)                              130125
0002.00 Dlast_name        s              8    inz(*blanks)                              130125
0003.00 Dname             s             13    inz(*blanks)                              130125
0004.00 C                   movel     'AMIT'        first_name                          130125
0005.00 C                   move      'JAISWAL'     last_name                           130125
0006.00 C     first_name    cat       last_name     name                                130125
0007.00 C     name          dsply                                                       130125
0008.00 C     first_name    cat(p)    first_name    name                                130125
0009.00 C     name          dsply                                                       130125
0010.00 C                   cat       first_name:3  last_name                           130125
0011.00 C     last_name     dsply                                                       130125
0012.00 C                   seton                                        lr             130125
****************** End of data *******************************************************


OUTPUT


DSPLY  AMIT  JAISWAL
DSPLY  AMIT AMIT    
DSPLY   JAISWAL     










User Comments:



Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy