Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

  • qq99350
  • Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0

qq99350 created the topic: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

IN DE.FORMAT.PRINT, THERE'S CALUCLATION FUNCTION.

AFTER I GET THE 'TOTAL.1' NUMBER

I WANT TO MAKE "TOTAL.1" NUMBER TO A NUMBER WITH PERCENTAGE SIGN.

EX:

TOTAL.1 = 0.66
I TRIED TO PUT % IN 'MASK' IT SHOWS LIKE 0.66%

BUT I WANT A NUMBER 66.67%
#9652

Please Log in or Create an account to join the conversation.

  • Posts: 2845
  • Karma: 512
  • Thank you received: 647

jpb replied the topic: Re: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

Setting MASK to % is defined as :
Print "%" after the data

So you have to make your TOTAL.1 look like you want beforehand, e.g.
FIELD..TEXT	"100.00"
CONVERSION 	*,TOTAL.1
MASK		%
#9657

Please Log in or Create an account to join the conversation.

  • qq99350
  • Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 5
  • Thank you received: 0

qq99350 replied the topic: Re: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

When I put "100" in FIELD/"TEXT" and "*,TOTAL.1" in Calculation, , the "100" becomes a TEXT but not a NUMBER..

Therefore, the system shows "CALCULATION.36 TOTAL INVALID FOR TEXT" after I click validate
#9670

Please Log in or Create an account to join the conversation.

  • Posts: 2845
  • Karma: 512
  • Thank you received: 647

jpb replied the topic: Re: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

Havent tried myself, maybe without quotes, use a I-DESC etc...

And worst you can use a routine :

@xxxxxxx
Where xxxxxxx is a user-created subroutine to carry out customised conversions. The subroutine must exist in PGM.FILE as a type ‘S’ record. The leading ‘@’ character must be entered before the subroutine name or it will not be recognised. The arguments used in calling the subroutine are xxxxxxx (IN.FIELD, HEADER.REC, MV.NO, OUT.FIELD, ERROR.MSG), where
IN.FIELD – unconverted data from calling routine
HEADER.REC – dynamic variable containing current Header record from calling routine
MV.NO – Current value number for carrier address (references Header record) from calling routine
OUT.FIELD – converted data from subroutine
ERROR.MSG - text error message generated by subroutine. If this is not null on return from the subroutine, the calling program will abort the conversion and place the message in the Repair queue.

#9673

Please Log in or Create an account to join the conversation.

  • Posts: 1
  • Thank you received: 0

NHUDA021 replied the topic: Re: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

jpb wrote: Havent tried myself, maybe without quotes, use a I-DESC etc...

And worst you can use a routine :

@xxxxxxx
Where xxxxxxx is a user-created subroutine to carry out customised conversions. The subroutine must exist in PGM.FILE as a type ‘S’ record. The leading ‘@’ character must be entered before the subroutine name or it will not be recognised. The arguments used in calling the subroutine are xxxxxxx (IN.FIELD, HEADER.REC, MV.NO, OUT.FIELD, ERROR.MSG), where
IN.FIELD – unconverted data from calling routine
HEADER.REC – dynamic variable containing current Header record from calling routine
MV.NO – Current value number for carrier address (references Header record) from calling routine
OUT.FIELD – converted data from subroutine
ERROR.MSG - text error message generated by subroutine. If this is not null on return from the subroutine, the calling program will abort the conversion and place the message in the Repair queue.


HOW TO DEBUG CONVERSION ROUTINE OF DE.FORMAT.PRINT?
#22835

Please Log in or Create an account to join the conversation.

  • VK
  • VK's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • TAFC|R13|R19|R20
  • Posts: 785
  • Thank you received: 110

VK replied the topic: Re: Problem IN DE.FORMAT.PRINT, CALCULATION FUNCTION

Hi
put there DEBUG statement and start tSM with -DEBUG parameter. Then start your tSA in another session.
#22836

Please Log in or Create an account to join the conversation.

Time to create page: 0.154 seconds