PACKKEY


NCHAR

 

The PACKKEY instruction appends one or more variables from a list into a single destination character variable. Unlike the PACK instruction, the PACKKEY instruction uses the defined length of each source field in the packing of the data, using spaces to fill in between the Length Pointer and the Physical Length. The instruction uses the following format:

 

 

[label]

PACKKEY

{dest}{sep}{source}

 

Where:

label

Optional. A Program Execution Label.

dest

Required. A previously defined Character String Variable or National Character String Variable that receives the appended source variables.

sep

Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.

source

Required. A previously defined Character String Variable, National Character String Variable, Numeric Variable, a list of string and/or numeric variables, or a VARLIST of string and/or numeric variables that are appended together and placed in the {dest} operand.

Flags Affected: EOS

Note the following:

  1. The transfer process is exactly the same as:

  2.  

     

    CLEAR

    {dest}

     

    ENDSET

    {source item 1}

     

    APPEND

    {BLANKS} TO {source item 1}

     

    RESET

    {source item 1}

     

    APPEND

    {source item 1} TO {dest}

     

    ENDSET

    {source item 2}

     

    APPEND

    {BLANKS} TO {source item 2}

     

    RESET

    {source item 2}

     

    APPEND

    {source item 2} TO {dest}

     

    ...

     

     

    ENDSET

    {source item n}

     

    APPEND

    {BLANKS} TO {source item n}

     

    RESET

    {source item n}

     

    APPEND

    {source item n} TO {dest}

     

    RESET

    {dest}

     

  3. Only the {dest} operand changes. All other operands remain unchanged.

  4. The criteria for transferring the data from {source} is as follows:

  5. The Form Pointer of {dest} is set to one (1) and its Length Pointer is set to the last character transferred. If all the list items are null, {dest} is set to null.

  6. If {dest} is too small, the remaining characters or list items are ignored and the EOS Condition Flag is set.

  7. {source} may be continued on additional lines by terminating each continued line with a colon (:) in place of the comma between the last list item on the continued line and the first list item on the new line.

 

 

See Also: Example Code, UNPACK, PACK, Character String Instructions

 



PL/B Language Reference PACK PARSE