Shaanpriya wrote:We will be getting a records of say length 20. In this record, one field(or one column) will be of type packed decimal and the starting position and the ending position of this field's going to be variable.
This leads to further questions:
1) Within a file, are the records all of the same layout? Number of columns, data types, etc. (I'm asking about the entire set of data and not just the packed decimal). In other words: What does the file look like )metadata)? Have you been given a layout, such as a COBOL file descriptor (FD) or maybe just a spreadsheet or text file?
2) Are you needing to retrieve a particular packed decimal column based upon values present in another column? For example: If Type = A then PDColumn2 else if Type = B then PDColumn3 else PDColumn4. Or maybe If Type = A then RawDataStart4Len3 else if Type = B then RawDataStart7Len5 else RawDataStart12Len2?
3) When a particular column (position/length) isn't used as your packed decimal value, will it still contain data that may be used elsewhere? If so, is it packed decimal, character, integer or another datatype?
4) When your packed decimal value starts in a certain position, is it always the same length and scale? For example, any packed decimal value starting in position 5 is always defined as 7,2? If not, what determines the length and scale?
In order to better answer your question, a more complete description of your incoming data and the rules you must use to determine where the desired data is located is essential.
There's a similar question regarding packed decimals in the General topic forum. Is this one related to that?
Regards,