convert COMP-3 data in readable mode

5 posts / 0 new
Last post
Anonymous
convert COMP-3 data in readable mode

 

 

 

 

I have a file on mainframe with packed data in it, the COBOL program 
which created this file had comp-3 variables defined in this file, is
it possible to convert this file to readable values by some utility.
 
One option is to read this file using another COBOL program and use MOVE for each variable to edited PICTURE variables, but I am looking for an alternative and easier solution. 
 
Regds!!
 
Anil
"; ; ; ;
Anonymous
Try Sort with Edit mask
You can try using SORT utilities mask feature to change the comp-3 data to readable format... Lets say your packed data is at 10th column and is of length 6, S9(4)V99 You could try the following sample sort card SORT FIELDS=COPY OUTREC=(1,9,10,6,ZD,EDIT=(TTTTTT),LENGTH=6) Let me know if this works Srini
Anonymous
Apart from writing a program
Apart from writing a program to convert the file, you can use a product like file aid which will allow you to browse the file and see the record layout according to a particular Cobol copybook layout. Fail Aid is a third party product that you may not have access to.
dchristensen
Offline
Joined: 02/05/2013 - 18:07
Also FileAID could reformat the file

Using the original and expanded pair of copybooks, you could use FileAID to reformat the packed fields from one file to full display format in another file.

Anonymous
Version that works

Hi.
I had the same issue. Above solution is almoast correct.
What will work is

SORT FIELDS=COPY OUTREC=(1,9,10,4,PD,EDIT=(TTTTTT),LENGTH=6)

you have to remember that 6 digits packed decimal is 4 bytes long.

Log in or register to post comments
Sponsored Listing