Is possible to process an EBCDIC file that has multiple and variable length record types
I am trying to bring in a EBCDIC file (PL/1) with multiple variable lengths and I can only get the first row to read. The layout looks like the following:
Basically you have a fixed-length 480 byte file with one record layout, according the PL1 description you posted. Not variable length, and it looks like the payload is binary, which is neither ASCII nor EBCDIC.
What columns are you interested in and what data type do you expect them to be in?
After the first row, the data is not readable. It is not coming in correctly. I must have to define it differently. The 480 is not all the redefines. Sometimes it is less than that.
I looked at your dclgen again and saw the "VAR" part in the 0 header, I missed that before.
The PL1 data type char var consists of a fixed bin(15) length prefix and then then the character data, so in your case with the redefinition your "IMAGE_CNTL_STRLEN" will contain the record length in bytes. (plus 2 bytes for field itself).
hmmm... that's not quite right, since the DCL1 "IMAGE_SEGMENT" is fixed 460 and the other 20 bytes are in the previous fields to make up 480 bytes exactly.
Does the data contain character or binary information? If you say that some records are not 480 bytes, can you compare that number of bytes with the first 2 bytes of the record to see if that does indeed contain the record length?