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

Author Message
G.S.Sekhar

New User

Joined: 19 Aug 2005
Posts: 5

 Posted: Fri Dec 02, 2005 11:28 am    Post subject: Give an example for TRUNC built in function Hi Please give an example for TRUNC built in function with postive and negative values. Thanks in advance. Somu...

balaji81_k

Active User

Joined: 29 Jun 2005
Posts: 118

 Posted: Fri Dec 02, 2005 12:28 pm    Post subject: Re: Give an example for TRUNC built in function hai, trunc is the functions used to truncate all the values after it encounter the decimal point. eg-1: trunc(15.9)=ans(15) trunc(-15.8)= ans(-15). iam not sure for -ve number but for +ve is correct
Nanda Krishna

New User

Joined: 30 Nov 2005
Posts: 19
Location: Bangalore

 Posted: Fri Dec 23, 2005 4:41 pm    Post subject: Hi, e.g. DCL (X,Y) DECIMAL FIXED(3,2); X = 3.32; Y = TRUNC(X); /* Y = 3.00 */ X = - 3.32; Y = TRUNC(X); /* Y = -3.00 */ Note: TRUNC doesn't truncate all the values after it encounter the decimal point. It only changes the fractional part of an argument to zero. (It may be +ve or -ve number)
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am scheduling between OPC and TWS give u... nsbl IBM Tools 4 Sun Mar 12, 2017 5:35 pm RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm

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