>Hi there,
>
>I have a program that uses scatter/gather. When it gathers the records from a table, there are several fields that get overwritten in the table that the fields are being updated to. These fields don't exist in the table that I am appending from. Is there a way to omit certain fields from being gathered when using that method. I know that I can gather only certain fields, but is there a way to omit certain fields also.
>
Using a cursor is my first choice, but SCATTER accepts a skeleton for fields for inclusion or exclusion (FIELDS LIKE/EXCEPT), and I use SCATTER NAME to scatter to an object, and GATHER NAME so that memvar issues don't arise; controlling the scope of data scattered, and passing the related values is a lot simpler; since the record is contained in one object, and we can have several sets of record data dpresent at one time using multiple objects or an array of objects. GATHER NAME also allows FIELDS LIKE/EXCEPT skeletons masks.
You may also want to look at SCATTER TO ARRAY or doing a SELECT with an array target; there is a disadvantage in that the order of fields is significant, you can use APPEND FROM ARRAY or GATHER FROM ARRAY or INSERT INTO..FROM ARRAY, and you can explicitly ADEL() rows or columns once extracted to eliminate specific fields, but the field reference is by index rather than name.
I tend to use SCATTER NAME...APPEND BLANK...GATHER NAME and build an array of object refs if I need multiple record images, and using a cursor won't work/can't be used.