*>>SOURCE FORMAT IS FIXED *> *************************************************************** *> Author: Brian Tiffin *> Date: 18-Nov-2008 *> Purpose: A plethora of CALL USING phrases *> Tectonics: cobc -c callered.c *> cobc -x calling.cob callered.o *> *************************************************************** identification division. program-id. calling. data division. working-storage section. 01 alpha1 pic x value is 'y'. 01 alpha2 pic xx. 01 alpha4 usage binary-long value 1234. 01 alpha8b usage binary-c-long value 1. 01 alpha8 pic x(8) value x"0000000000000000". 01 number1 pic 9. 01 number2 pic 999. 01 number4 pic 9(9). 01 number8 pic 9(18). local-storage section. linkage section. screen section. *> ************************************************************** procedure division. call "subprogram" using by reference alpha1 by content alpha1 by value size is 4 alpha4 returning number4 end-call call "OCDUMP" using alpha8 8 end-call call "callered" using by value size 1 alpha1 by value size 2 alpha2 by value size is 4 alpha4 by value size is 4 alpha4 by value size is 8 alpha8 returning number4 end-call goback. end program calling. *> *************************************************************** *> *************************************************************** identification division. program-id. subprogram. data division. working-storage section. linkage section. 01 alpha1-1 pic x. 01 alpha1-2 pic x. 01 alpha1-3 pic x. 01 alpha1-4 usage binary-long. *> ************************************************************** procedure division using alpha1-1 alpha1-2 by value size is 4 alpha1-4. display alpha1-1 end-display display alpha1-2 end-display display alpha1-4 end-display display alpha1-1 alpha1-2 alpha1-4 end-display move alpha1-4 to return-code goback. end program subprogram.