IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 19, 2010 1:38 pm
Reply with quote

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...
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Wed May 19, 2010 2:12 pm
Reply with quote

the z principles of operations will tell all You need to know on number representation in computers ...
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Wed May 19, 2010 2:14 pm
Reply with quote

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.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 19, 2010 2:38 pm
Reply with quote

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...
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Wed May 19, 2010 2:47 pm
Reply with quote

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.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 19, 2010 8:20 pm
Reply with quote

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?
icon_question.gif icon_mad.gif icon_mad.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed May 19, 2010 8:31 pm
Reply with quote

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?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed May 19, 2010 8:36 pm
Reply with quote

Set it to negative 1 and all will be foregiven.... icon_wink.gif

Or (if you like using cycles) set it to 0 then subtract 1. icon_eek.gif

Bill
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Wed May 19, 2010 8:36 pm
Reply with quote

"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?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Wed May 19, 2010 9:38 pm
Reply with quote

for a FIXED BIN(31,0) does 2**31 hint anything ???
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


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

PostPosted: Thu May 20, 2010 12:21 pm
Reply with quote

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.
Back to top
View user's profile Send private message
henry888

New User


Joined: 21 Sep 2009
Posts: 51
Location: china

PostPosted: Thu May 20, 2010 8:24 pm
Reply with quote

Bill O'Boyle wrote:
Set it to negative 1 and all will be foregiven.... icon_wink.gif

Or (if you like using cycles) set it to 0 then subtract 1. icon_eek.gif

Bill


it is right...from data storage to see,FFFFFFFF = -1 icon_lol.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


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

Back to Top