Page 1 of 1

arithmetic expression in DISPLAY command

PostPosted: Tue Jul 15, 2014 9:33 pm
by durgam4
Hi ,
I would like to do arithemetic calculations in DISPLAY command. is it possible.

DISPLAY FROM(SMFTOUT) LIST(SYSLIST)
HEADER('POF# ') ON(81,04,BI)

I want
A = VALUE OF( 81,04,BI)

DISPLAY FROM(SMFTOUT) LIST(SYSLIST)
HEADER('POF# ') ON(A+16,04,BI)

is it possible in ICETOOL?

Re: arithmetic expression in DISPLAY command

PostPosted: Tue Jul 15, 2014 10:36 pm
by BillyBoyo
It is not really clear what you want. Can you give some sample input and expected output for that sample? Also describe in words what you are trying to do, the requirement you are trying to fulfil, not how you've decided to attempt it.

The answer to the above is probably No, but can't be sure, and there may be another to do what you want.

Re: arithmetic expression in DISPLAY command

PostPosted: Tue Jul 15, 2014 10:47 pm
by durgam4
Hi Billy, thanks for replying.

INPUT file is SMFTYPE 30 Records.
let A = (77,4, BI) ( from 77th position 4 bytes binary)
assume it contains a value 904
Now I want to display
HEADER('POF# ') ON(A+16,04,BI)
i.e HEADER('POF# ') ON(904+16,04,BI)
i.e HEADER('POF# ') ON(920,04,BI)

Re: arithmetic expression in DISPLAY command

PostPosted: Tue Jul 15, 2014 11:30 pm
by BillyBoyo
Well, No, you can't do that. You'd have to pre-process the file so that it contained an extended field with the result of your calculation. You could do a COPY with a USING(....) prior to your DISPLAY, or do it in a SORT step using OUTFIL reporting features, so you only read the input once.