This is my Challenge. I tried to search in this forum and could not get it.
1. I have 40 PS files with variable and fixed length
2. These 40 files have PD and ZD in them
3. I need to build one single program which takes in both variable and fixed length files , Identifies the PD and ZD and convert them to unpacked display format.
4. The output file should be fixed length file
5. Need a cobol program/Utility to do this
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
You need to more clearly explain your requirement.
For one thing, i believe ZD is "unpacked display format' unless you have something else in mind.
Fields are defined, not identified by or detected from the content. There is no way to look at data programmatically and determine how long a "field" is or what data format it is. You might detect the low-order byte of a packed-decimal field, but not with any guarantee - you would also not be able to guarantee finding the length from the data.
Who came up with this "need"
I need to build one single program which takes in both variable and fixed length files , Identifies the PD and ZD and convert them to unpacked display format.
It is surely not a business requirement.
If these are files that have been in use in your environment, it is likely that they have cobol copybooks. If you take the existing copybooks, and clone them, you could define the needed output fieldsd in the "new" copybooks. You could use both copybooks in a program and move the old format data to the new, unpacked format data. These would be trivial programs and once one was running, the remainder would be even more trivial.