# Set high-value to FIXED BIN(31,0)

Author Message
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

 Posted: Wed May 19, 2010 1:38 pm how to set high value to the variable defined with type FIXED BIN(31,0). e.g: DCL RECV_PARM1 FIXED BIN(31); and how to set high value to RECV_PARM1; after that how to judge if the variable is high value or not? please have a guide...
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

 Posted: Wed May 19, 2010 2:12 pm the z principles of operations will tell all You need to know on number representation in computers ...
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

Posted: Wed May 19, 2010 2:14 pm

You could

 Code: DCL  RECV_PARM1  FIXED BIN(31); DCL  RECV_PARM1_OV  CHAR(4) BASED(ADDR(RECV_PARM1));   RECV_PARM1_OV = HIGH(4);   IF RECV_PARM1_OV = HIGH(4)       THEN......

Garry.
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

Posted: Wed May 19, 2010 2:38 pm

Garry Carroll wrote:
You could

 Code: DCL  RECV_PARM1  FIXED BIN(31); DCL  RECV_PARM1_OV  CHAR(4) BASED(ADDR(RECV_PARM1));   RECV_PARM1_OV = HIGH(4);   IF RECV_PARM1_OV = HIGH(4)       THEN......

Garry.

in called procedure I defined as:
DCL SEND_PARM1 FIXED BIN(31);
DCL SEND_PARM1_OV CHAR(4) BASED(ADDR(SEND_PARM1));
SEND_PARM1_OV = HIGH(4);
in calling procedure I define as:
DCL RECV_PARM1 FIXED BIN(31);
DCL RECV_PARM1_OV CHAR(4) BASED(ADDR(RECV_PARM1));

after called,I checked RECV_PARM1_OV,it is not high value...
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

 Posted: Wed May 19, 2010 2:47 pm I think you need to review the scope of your variables, the call to the called procedure and the PROC statement of the called procedure. Unless you are passing the address of SEND_PARM1 in the call, and resolving it in the called PROC , the RECV_PARM1 and RECV_PARM1_OV are local to the called procedure - and out of scope for the calling procedure. Garry.
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

 Posted: Wed May 19, 2010 8:20 pm as written in PLI Language Reference: Unless an argument is passed BYVALUE, a reference to an argument, not its value, is generally passed to a subroutine or function. This is known as passing arguments by reference, or BYADDR. A reference to a parameter in a procedure is a reference to the corresponding argument. Any change to the value of a parameter is actually a change to the value of the corresponding argument. and refer to my replies above,actually what I need is that in the called function procedure the SEND_PARM1 should be set to high value,and in the calling procedure RECV_PARM1 is corresspoding to SEND_PARM1.And if SEND_PARM1 is set to high value,RECV_PARM1 should also be the high value as said in Language Reference. So the key point is how to really set SEND_PARM1 with the high value?
CICS Guy

Senior Member

Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

Posted: Wed May 19, 2010 8:31 pm

 henry888 wrote: how to set high value to the variable defined with type FIXED BIN(31,0). e.g: DCL RECV_PARM1 FIXED BIN(31); and how to set high value to RECV_PARM1; after that how to judge if the variable is high value or not? please have a guide...
Just what value do you consider to be 'high value' in DCL RECV_PARM1?
Bill O'Boyle

CICS Moderator

Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

 Posted: Wed May 19, 2010 8:36 pm Set it to negative 1 and all will be foregiven.... Or (if you like using cycles) set it to 0 then subtract 1. Bill
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

 Posted: Wed May 19, 2010 8:36 pm "Just what value do you consider to be 'high value' in DCL RECV_PARM1?" I also have the same question...but it is needed in the requirement. I know in COBOL language it is like 'FFFFFFFF',but merely to mention this word in PLI,any idea?
enrico-sorichetti

Superior Member

Joined: 14 Mar 2007
Posts: 10833
Location: italy

 Posted: Wed May 19, 2010 9:38 pm for a FIXED BIN(31,0) does 2**31 hint anything ???
Garry Carroll

Senior Member

Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

Posted: Thu May 20, 2010 12:21 pm

Can you show the code for the CALL statement and the start of the called procedure?

youy should have
 Code: CALL  subproc(SEND_PARM1);

and
 Code: subproc: PROC(RECV_PARM1);  DCL  RECV_PARM1 ......

Garry.
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

Posted: Thu May 20, 2010 8:24 pm

 Bill O'Boyle wrote: Set it to negative 1 and all will be foregiven.... Or (if you like using cycles) set it to 0 then subtract 1. Bill

it is right...from data storage to see,FFFFFFFF = -1
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics comparasion between BIN FIXED(63) an... PL/I & Assembler 10 Variable length(Pipe delimter) to Fix... DFSORT/ICETOOL 8 from CSV to fixed DFSORT/ICETOOL 7 How can I convert charactor to fixed ... DFSORT/ICETOOL 7 Need all records with high key SYNCSORT 15
Search our Forums:

 IBMMainframes.com is not an official and/or affiliated with IBM® in anyway Board Rules | FAQ | Downloads | Wiki | SiteMap | Contact Us