Skip to main content
Close announcements banner

Copy_I_To_O: Copy buffer I to buffer O

This operation eliminates the need to recopying the fields from buffer I to the fields of buffer O one by one. 

Both buffers need to be identically defined in structure, even if the names of the fields differ.

It is possible to group fields but it is necessary to take careful notice of the type of fields since it is a bytes copy that is performed. There will not be any transcoding (Unicode to EBCDIC on AS/400 IBMi or numerical to alpha)

 

Example :

The I buffer has the following fields: 

I.CLE ZONED 5,0 

I.DESCRIPTION CHAR 10)

I.DATYYYY CHAR 4

I.DATMM CHAR 2

I.DATDD CHAR 2

 
DCL O.KEYCODE ZONED 5,0 KEYORDER 1 NULL Same
DCL O.DESCRIPTION CHAR 10 NULL Same
DCL O.DATEMAJ CHAR 8 NULL Same

Option NULL_SUPPORT
If I.DESCRIPTION = Null Then Goto *Skip
Copy_I_To_O

 

If the I.DATYYYY field is null, the O.DATEMAJ field is null as well. 

Take note of descriptions as they need to match the null processing.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!