Skip to Content
Custom Search

convert COMP-3 data in readable mode

4 replies [Last post]
Anonymous

 

 

 

 

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
"; ; ; ;
Sponsored Listing
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.

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
Posts:
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
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

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Who's online

There are currently 2 users and 29 guests online.

Online users

  • Phiseetatsmet
  • MupEsogsMuh
Dr. Radut | forum