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
Posted: Thu Dec 08, 2016 8:58 pm (GMT 5.5)

My input:
Code:
518791041070069


I read more about having multiple IFTHEN and improved code to:
Code:
OPTION COPY                                       
INREC IFTHEN=(WHEN=INIT,                           
      BUILD=(1,1,UFF,MUL,+2,EDIT(IT),             
             2,1,UFF,MUL,+1,EDIT(T),               
             3,1,UFF,MUL,+2,EDIT(IT),             
             4,1,UFF,MUL,+1,EDIT(T),               
             5,1,UFF,MUL,+2,EDIT(IT),             
             6,1,UFF,MUL,+1,EDIT(T),               
             7,1,UFF,MUL,+2,EDIT(IT),             
             8,1,UFF,MUL,+1,EDIT(T),               
             9,1,UFF,MUL,+2,EDIT(IT),             
            10,1,UFF,MUL,+1,EDIT(T),               
            11,1,UFF,MUL,+2,EDIT(IT),             
            12,1,UFF,MUL,+1,EDIT(T),               
            13,1,UFF,MUL,+2,EDIT(IT),             
            14,1,UFF,MUL,+1,EDIT(T),               
            15,1,UFF,MUL,+2,EDIT(IT))),           
      IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C' ',C'')))


Result is:
Code:
10116718104201400618


number of digits in Result will vary based on input. How do I tell SORT to pick all the digits when adding them?

P.S. - I was amazed to know every IFTHEN picks up amendments done by previous IFTHEN. I didn't know that.

Thanks.


Viewing all articles
Browse latest Browse all 9405

Trending Articles