Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
henry888

New User

Joined: 21 Sep 2009
Posts: 51
Location: china

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

Global Moderator

Joined: 14 Mar 2007
Posts: 10457
Location: italy

 Posted: Wed May 19, 2010 2:12 pm    Post subject: Reply to: Set high-value to FIXED BIN(31,0) 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: 1005
Location: Dublin, Ireland / Edinburgh, Scotland

Posted: Wed May 19, 2010 2:14 pm    Post subject:

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    Post subject:

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);
SEND_PARM1_OV = HIGH(4);
in calling procedure I define as:
DCL RECV_PARM1 FIXED BIN(31);

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

Senior Member

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

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

Posted: Wed May 19, 2010 8:31 pm    Post subject: Re: Set high-value to FIXED BIN(31,0)

 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: 2504
Location: Atlanta, Georgia, USA

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

Global Moderator

Joined: 14 Mar 2007
Posts: 10457
Location: italy

 Posted: Wed May 19, 2010 9:38 pm    Post subject: Reply to: Set high-value to FIXED BIN(31,0) for a FIXED BIN(31,0) does 2**31 hint anything ???
Garry Carroll

Senior Member

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

Posted: Thu May 20, 2010 12:21 pm    Post subject:

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    Post subject: Re: Reply to: Set high-value to FIXED BIN(31,0)

 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
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Need all records with high key kalidasvs SYNCSORT 15 Fri Feb 09, 2018 10:38 pm Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm ESQA overflow - high ECSA utilization vasanthz All Other Mainframe Topics 1 Thu Dec 29, 2016 7:06 am High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us