Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Subject: Re: Reply to: Performing arithmetic on input field
Posted: Wed Dec 07, 2016 10:18 pm (GMT 5.5)

Thanks Bill.

1. I learnt it later when I read about Mask.
2. I am aware of use of 'I' in EDIT
3. I didn't know, I was using arithmetic first the first in SORT - Thanks
4. Yes PDF has examples but always problem is discussed on different page. Ideally it should have link to go directly to the problem description by one click. It difficult to absorb example (sample) if problem is discussed on a different page.

Thanks for your comments. They helped to use PDF better.

Bill Woodger wrote:
If you don't specify a length (with LENGTH or an explicit EDIT mask) you get a default length. If you don't provide an explicit EDIT, you get a default mask.

"I" in an EDIT means "a blank if there is no significant digit encountered yet", so leading zeros you ask to be blank.

You need a + (or -) because that is how DFSORT will tell if you are specifying a numeric literal, or the (incomplete) start of a field definition.

I'm pretty sure the examples for 2.1 are the same as for 2.2, for instance, p136 in both documents:

Quote:
arexp,edit or (arexp),edit
specifies that the edited result of an arithmetic expression is to appear in the reformatted input record. The arithmetic expression can consist of input fields, decimal constants, operators and parentheses. An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified.
See arexp,edit under OUTFIL OUTREC for details.

Code:
Sample Syntax:
INREC FIELDS=(C’**’,27,2,FI,MIN,
83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
15:(((15,5,ZD,ADD,+1),MUL,+100),DIV,62,2,PD),M25,LENGTH=10)


Note the use of FIELDS instead of BUILD, which likely indicates that this example has been around for more than 10 years.


Viewing all articles
Browse latest Browse all 9405

Trending Articles