View previous topic :: View next topic |
Author |
Message |
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Sat Sep 10, 2005 11:09 am Post subject: COMP-3 display on ISPF panel |
|
|
Hi all,
I need to display a COMP-3 variable on the ISPF panel. Can any one let me know how to go about it.
The variable is being read from a seq file. i just need to display it on the ISPF panel. when i tried doing it. its displaying some junk values.
Thanks,
Tattva |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Sat Sep 10, 2005 11:53 am Post subject: |
|
|
It is difficult to tell you what is wrong since you haven't told us what you've tried. How did you VDEFINE the variable? |
|
Back to top |
|
|
SureshKumar Intermediate
Joined: 23 Jan 2003 Posts: 211 Topics: 21
|
Posted: Sat Sep 10, 2005 3:06 pm Post subject: |
|
|
tattva,
COMP-3 is Packed Decimal. Go to File-Aid and view it in 'formatted' mode with a copybook. Are you new to mainfarme? these are not junk values or as semiqeezer posted I too don't understand the question. Thanks |
|
Back to top |
|
|
tattva Beginner
Joined: 02 Feb 2005 Posts: 97 Topics: 36
|
Posted: Wed Sep 14, 2005 11:40 am Post subject: |
|
|
Hi all,
Sorry for the delay in replying...
Let me state my requirement with an example:-
Ex :- X = 1234 ( in COMP-3 format)
My REXX code should read this and display 1234( normal format) on the ISPF panel.
Suresh,
I do know COMP-3 is Packed decimal.
Would be great if anyone can provide a solution to this.
Thanks,
tattva |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Sep 14, 2005 12:02 pm Post subject: |
|
|
tattva,
Try this
Code: |
/* REXX CONVERT PACKED DECIMAL TO NUMBER */
PARSE ARG PACK_NUM
HEX_NUM = C2X(PACK_NUM)
SIGN = RIGHT(HEX_NUM,1)
NUMBER = LEFT(HEX_NUM,LENGTH(HEX_NUM)-1)
IF SIGN = 'D' THEN
RETURN '-'| |NUMBER
ELSE
RETURN NUMBER
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Wed Sep 14, 2005 8:35 pm Post subject: |
|
|
My point was that when you VDEFINE the variable, use PACK format. See the link I gave above. Unless, as Kolusu assumed, you are doing this from Rexx in which case you either need to write the converson yourself as he did or call a small program to do the ISPF work (vdefines, display, etc) for you.
VDEFINE is not available in Rexx and CLIST because the ISPF function pool IS the rexx or clist variable pool. |
|
Back to top |
|
|
|
|