IBM Says
PHP Code:
//
// data structures
//
d cheesepizza ds qualified inz
d wheat 10
d yeast 15
d basil 20
d cheese 2 0
d meatpizza ds qualified inz
d wheat 10
d yeast 15
d basil 20
d cheese 25
d meat 30
/Free
//--------------------------------------------------------
// MAIN PROGRAM
//--------------------------------------------------------
// notice the two data structures cheese is defined as 2,0
// in cheesepizza but its 25 *char in meatpizza...
// Also meat pizza has MEAT.
// how can I move the data from cheesepizza to
// meatpizza easily????
// V5R4 has the eval-corr opcode .
// The EVAL-CORR operation assigns data and null-indicators
// from the corresponding
// subfields of the source data structure to the subfields
// of the target data structure.
cheesepizza.wheat = 'wheat';
cheesepizza.yeast = 'yeast';
cheesepizza.basil = 'basil';
cheesepizza.cheese = 11;
eval-corr meatpizza = cheesepizza;
// _________________________________
//
// D E B U G S A Y S
// _________________________________
// EVAL meatpizza
// MEATPIZZA.WHEAT = 'wheat '
// MEATPIZZA.YEAST = 'yeast '
// MEATPIZZA.BASIL = 'basil '
// MEATPIZZA.CHEESE = ' '
// MEATPIZZA.MEAT = ' '
*inlr = *on;
/End-Free
Comment