I have redefines clause in a copybook that I have to load into oracle external table using the file sent over. Below is the copybook information. Incoming file is in positional format Should I assume in the data record in file, first 8 characters is for alphanumeric, and next 8 characters is for numeric. I just need to know if I should account for 16 characters total for this, because there are other fields in the copybook before and after this field.
e.g.
ENROLLMENT-DT PIC X(08). ENROLLMENT-DT-N REDEFINES ENROLLMENT-DT PIC 9(08
Allow 8 bytes in total for the 2 fields. For this example, redefines signifies the 2 fields occupy the same position in the record. The copybook lets you look at the field as either a String field or a Text field
Another example of redefines is
This allows you to access date in both YYYYMMDD format + the individual Year/Month/Day fields
then
Similarly if you do
then Birth-Date=20200221
If the file is coming from an IBM Mainframe, the RecordEditor can display the position/length of a Cobol Copybook fields
In RecordEditor option Utilities >>> Display Cobol Copybook a Cobol copybook is displayed like:
finally the cb2xml will convert a Mainframe Cobol copybook to xml (with the position and lengths in the Xml).