Page 1 of 1

how do you view comp-3 fields?

PostPosted: Wed Oct 27, 2010 7:27 pm
by sridhar4mfs
how do you view comp-3 fields?

Re: how do you view comp-3 fields?

PostPosted: Wed Oct 27, 2010 7:46 pm
by Robert Sample
"View" as show on a CICS screen?
"View" as show in TSO/ISPF?
"View" as COBOL DISPLAY to SYSOUT?

Re: how do you view comp-3 fields?

PostPosted: Mon Nov 08, 2010 7:23 pm
by hariprasad33
hi sridhar4mfs,

Suppose if you have mentioned a field in COMP-3 format in cobol,that field appears in the generated file (in "VIEW" mode) as a packed decimal format.so,if you want see that field in decimal format write a simple sort card for expanding that filed using "EDIT" keyword.
for exmaple: OUTREC FIELDS=(1:1,6,PD,EDIT(TTTTTTTTTTT)) means Display start from positions 1to 11(in decimal format) in output,taken from length 1 to 6(in packed decimal format) in input.so,like this we can expand from packed decimal to decimal digits.by doing this way,we can view comp-3 fiedls.

kindly let me know if you have any query.


Thanks,
Hariprasad Borra.

Re: how do you view comp-3 fields?

PostPosted: Tue Nov 09, 2010 12:53 am
by dick scherrer
Hello and welcome to the forum,

As this is a "cobol" question, a cobol answer would be more appropriate than a sort solution.

Actually, Sridhar should answer the questions Robert posted. . .

Re: how do you view comp-3 fields?

PostPosted: Tue Nov 09, 2010 4:15 pm
by littlechicken
sridhar4mfs wrote:how do you view comp-3 fields?



In a CICS formatted dump? A abendaid dump? in which method are you referring to - In a database ?

Re: how do you view comp-3 fields?

PostPosted: Wed Nov 10, 2010 10:25 pm
by Quasar
Shridhar -

You have not clarified the context in which you have posted this query. Do you want to see this data in a File, or if it is an intermediate value in a COBOL Pgm.
1. In case the COMP-3 Data, that you want to see is the data in a Mainframe File, and you would like to see the contents on TSO/ISPF, you can turn the HEX ON on the Command Line. In the below file, the last 2 Bytes are COMP-3 Data. You read the Hexa-decimal value in a top-down fashion.

Image

2. If you have software tools like File-Aid or IBM's File Manager, you can use them to browse the contents of a File, and see the data in a COMP-3 Column. Take a look below, how I am browsing the file, using IBM's File Manager Tool -

Image

3. You may also DISPLAY this in COBOL, by first MOVE'ing the data to a Numeric-Edited DISPLAY Format Variable.
01 COMMISSION  PIC S9(03) COMP-3
01 WS-COMMISSION PIC -Z(03).

MOVE COMMISSION TO WS-COMMISSION
DISPLAY WS-COMMISSION


Thank you very much.