Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Set high-value to FIXED BIN(31,0)
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed May 19, 2010 2:12 pm    Post subject: Reply to: Set high-value to FIXED BIN(31,0)
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed May 19, 2010 2:14 pm    Post subject:
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Wed May 19, 2010 2:47 pm    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Wed May 19, 2010 8:31 pm    Post subject: Re: Set high-value to FIXED BIN(31,0)
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed May 19, 2010 8:36 pm    Post subject: Reply to: Set high-value to FIXED BIN(31,0)
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed May 19, 2010 9:38 pm    Post subject: Reply to: Set high-value to FIXED BIN(31,0)
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu May 20, 2010 12:21 pm    Post subject:
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    Post subject: Re: Reply to: Set high-value to FIXED BIN(31,0)
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts How to copy data with delimters to fi... Venkata Ramayya DFSORT/ICETOOL 2 Wed Feb 24, 2016 10:03 pm
No new posts FIXED BIN (31) and FIXED BIN (63) - H... sundarkudos PL/I & Assembler 4 Thu Nov 05, 2015 1:11 pm
No new posts CICS- Moving to High availability vicky10001 CICS 8 Fri Oct 23, 2015 7:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us