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

Author Message
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Thu Aug 02, 2007 8:54 pm    Post subject: How to find root(âˆš) value using HLASM instructions Hi friends, Anybody know how to find the root(âˆš) value using assembler instructions, and also finding log values using assembler instructions. If you know how to code for it please give me.

William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Thu Aug 02, 2007 9:19 pm    Post subject: Re: How to find root(âˆš) value using HLASM instructions

 sjothiprakash wrote: root(âˆš)
As in square root, the math function?
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Thu Aug 02, 2007 9:28 pm    Post subject:

Hello,

Here is some pseudo-code for square-root calculation
 Code: read in number  if number > 0 then      left =  0      right =  number + 1      loop while (right - left) > 0.001      mid =  (left + right)/2         if ( mid*mid < number ) then             left =  mid          else             right =  mid         ifend     loopend     write out 'Square root of ' Number ' is ' mid  else     write out 'Illegal value: '  ifend
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Fri Aug 03, 2007 9:33 pm    Post subject: Hi Scherrer, I hope the pseudo will give the square root value of a number but how to check the loop condition with the floating point value(0.001). And also as a fresher to assembler i dont know divisions with rounding(DP & CP) will give the excat value which will need to used in the loop condition. Can you give me one more example related to assembler instructions. William, Yes, your question is correct, i am asking for maths root calculation. Please Give me a clear picture.
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

 Posted: Fri Aug 03, 2007 10:02 pm    Post subject: Haven't tried it myself, but (one way or another) you should be able to call the Language Environment math services. The sample COBOL call to CEESSLOG--logarithm base e looks fairly straight forward.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Fri Aug 03, 2007 10:27 pm    Post subject:

Hello,

 Quote: how to check the loop condition with the floating point value(0.001).

I don't believe the 0.001 is really a floating point value - it is merely a decimal number with scaling (or a fraction) - unless that is also floating point - long ago having a floating decimal was not a floating point number (which was used for scientific notion).

As far as division and remainders, you might want to use binary numbers (rather than packed-decimal) for calculating. I seem to recall that if use something like the following you will have your remainder in a register"
 Code: L     R8,HEX0         EVEN/ODD PAIR, RESULT = REMAINDER          L     R9,HEX5         EVEN/ODD PAIR, RESULT = QUOTIENT          L     R3,HEX2         DIVISOR          DR    R8,R3         * DIVIDE, REGISTER & REGISTER
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Mon Aug 06, 2007 2:22 pm    Post subject: Re: How to find root(âˆš) value using HLASM instructions William, Can you please tell me which Library should be called for "Language Environment Programming services"
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

 Posted: Mon Aug 06, 2007 2:38 pm    Post subject: The LE libs should already be available......
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Mon Aug 06, 2007 2:40 pm    Post subject: But there is Reason code=12 for link editing....
William Thompson

Global Moderator

Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

Posted: Mon Aug 06, 2007 2:42 pm    Post subject:

 sjothiprakash wrote: But there is Reason code=12 for link editing....
OK.....
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Mon Aug 06, 2007 2:58 pm    Post subject: This is the error what i got on link editing ABEND 013-64 OCCURRED WHILE PROCESSING PARTITIONED DATA SET WITH DDNAME SYSLIB. UNABLE TO PROCESS LIBRARY SYSLIB DURING AUTOCALL PROCESSING. SYMBOL CEESSSQT UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY. MODULE ENTRY NOT PROVIDED. ENTRY DEFAULTS TO SECTION SAMPLE2.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

Posted: Mon Aug 06, 2007 6:11 pm    Post subject:

Hello,

You need to research your abend code before posting. This is from the manual linked to from the forums.
 Quote: 64 An OPEN macro instruction was issued for a null data set using an access method other than QSAM or BSAM. Correct the DD statement to specify a real data set, or access the data set using BSAM or QSAM.

If there are inconsistencies in your library concatenation/specification, you need to talk with your system support people to find out where your problem is.
sjothiprakash

New User

Joined: 21 Jul 2007
Posts: 12
Location: Chennai

 Posted: Mon Aug 06, 2007 7:49 pm    Post subject: Hi dick, Now I changed my JCL appropriatly, but still its shown RC=12 for CEESSSQT as : " SYMBOL CEESSSQT UNRESOLVED. MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL LIBRARY "
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Mon Aug 06, 2007 8:20 pm    Post subject: Hi Jothi, I'd suggest talking with your system support people and make sure that your assemble/link includes all of the LE libraries. Have you tried to call this using a COBOL program? If you do so, and it works, you may see that the libraries used for COBOL are not the exact same as the ones in your assembly. If you are going to use these callable routines, i'd suggest you work with the system support people so there will be a standard method (if one does not alerady exist). If each developer creates their own compile/assemble/link jcl, it may cause all sorts of problems later.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Command to find TMEMBER name for a TPIPE Siva NKK Kothamasu IMS DB/DC 0 Wed Aug 16, 2017 6:08 pm HLASM bug steve-myers PL/I & Assembler 2 Wed Jul 26, 2017 6:02 pm find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm

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