I'm trying to read a Cobol/VSAM data file in complex flat file stage on 8.5 enterprise edition. Most data shows up properly except for date. It displays as 1130131. (with a dot at the end) and I have no idea how to convert this.
Initially thought this was Julian date but a quick search for conversion shows a different century. All I know is the file was generated this month so date is pretty recent. This data needs to be loaded to an Oracle database with Date as the data-type.
Does anyone out here know how this is represented and a method of converting this to Oracle date? And why is there a dot at the end of this field (as with many others). Thanks in advance!
Cobol date format
Moderators: chulett, rschirm, roy
You should ask the data provider for the specifics on how the date is formatted. Lacking that information, is the value in your example the only value you have encountered, or are there other values which you can examine to determine a pattern? Also, look at what the date is supposed to represent: Birthdate, open date, start date, end date, purchase date, etc., especially in light of what the file itself represents.
A couple of very wild guesses: YYYMMDD or MMDDYYY, and maybe add the YYY value to 1900? Likely aren't right, but might give you a starting point to play around with.
As for the trailing decimal point, my guess is that the fields are defined as Decimals and have no scale (scale=0), although you have not stated so. When you view these, DataStage will always include a decimal point (as well as a leading byte for the sign). If the scale of the decimal is 0, the decimal point will appear at the end.
Regards,
A couple of very wild guesses: YYYMMDD or MMDDYYY, and maybe add the YYY value to 1900? Likely aren't right, but might give you a starting point to play around with.
As for the trailing decimal point, my guess is that the fields are defined as Decimals and have no scale (scale=0), although you have not stated so. When you view these, DataStage will always include a decimal point (as well as a leading byte for the sign). If the scale of the decimal is 0, the decimal point will appear at the end.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
Using a flag to indicate the century is a non-standard approach for COBOL in general. The Y2K kerfluffle forced everyone to take a rational look at storage formats without actually thinking about consistent standards... or so I see it.
The standard is to use the most efficient storage format that does not need additional code to read or display. Packed decimal (COMP-3) is a good example. Dates have a sort of schizophrenia, because they are at the same time text displays and numeric values.
The standard is to use the most efficient storage format that does not need additional code to read or display. Packed decimal (COMP-3) is a good example. Dates have a sort of schizophrenia, because they are at the same time text displays and numeric values.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872