There is no built-in option for this in most programming languages (many OO programing languages for example have a toString
(or similar) method, but this does what the object says (and may not include a single actual content of the a variable at all).
COBOL works with statements (like the DISPLAY
you've mentioned) while var_dump
is a php built-in function. Different OO programming languages have the option to use a kind of reflection allowing you (with some prerequisites) to write a var_dump function on your own but as far as I know no COBOL compiler that supports OO has a reflection feature.
As @cschneid mentioned there was the EXHIBIT
statement (actually that link is the best doc I've found for it) but no implementation that supports it (as far as I know) display's the record's sub-fields as separate like var_dump does.
CEE3DMP as z/OS would not help you as it dumps everything you specify - but you cannot specify a single variable. Other dump routines there will also not workas you've asked (for the record, splitted into subfields).
So to answer the to the question is - "no, there is no standard option to dump records".
If you aren't restricted to any COBOL implementation you could add this language feature into GnuCOBOL, also works as 64bit-COBOL on z/OS ;-)