hello all,
could anyone tell me what editc and editw does
thx in advance
sashi
could anyone tell me what editc and editw does
thx in advance
sashi
There are times when programmers need to convert numbers to characters. I use %EditC built in function using edit code 'X'. Example: 1. Time 34233 (say 3.42.33 am); TextFd = %EditC(Time:'X') Returns '034233' when TextFd is 6A. 2. Number 123; TextFd = %EditC(Number:'X') Returns '000123'
Q. Can I modify the IBM-shipped edit codes 5 through 9, or is that not permitted because an OS/400 program uses them? I want to use edit code 9 to display a YYMMD date format from a six-digit field. A. Yes, you can modify edit codes 5 through 9 for your own purposes although IBM predefines them. To work with edit descriptions, type GO CMDEDTD at an AS/400 command line to display a list of the available edit description commands. Note that you can't actually modify the edit description; instead, you must delete it with the DLTEDTD command and then create a new one with the CRTEDTD command. You can find more information about creating user-defined edit descriptions in Application Display Programming (SC41-5715). As an alternative to changing the user-defined edit descriptions, you might consider using edit words. Edit words provide maximum flexibility in creating edit masks.
FQPrint O F 80 Printer D Unedited S 8S 2 D Edited S 8S 2 D PhoneBefore S 10S 0 D PhoneAfter S 10S 0 C Eval UnEdited = 567 C Eval Edited = 567 C Except first C Except second C Except third C Except fourth C Except fifth C Except sixth C Except seventh C Except eighth C Except ninth C Eval UnEdited = 123456 C Eval Edited = 123456 C Except tenth C Eval UnEdited = 567 C Eval Edited = 567 C Except eleventh C Eval UnEdited = -567 C Eval Edited = -567 C Except twelvth C Except thirteenth C Eval UnEdited = 567 C Eval Edited = 567 C Except twelvth C Except thirteenth C Eval UnEdited = -567 C Eval Edited = -567 C Except fourteenth C Eval PhoneBefore = 7145551212 C Eval PhoneAfter = 7145551212 C Except fifteenth C Except sixteenth C Eval UnEdited = 567 C Eval Edited = 567 C Except seventeent C Eval UnEdited = 000000.07 C Eval Edited = 000000.07 C Except eighteenth C Eval *InLr = *On OQPrint E First 1 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' ' OQPrint E Second 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' . ' OQPrint E Third 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' 0 . ' OQPrint E Fourth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited '0 . ' OQPrint E Fifth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' & ' OQPrint E Sixth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' *. ' OQPrint E Seventh 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited '* . ' OQPrint E Eighth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' $0. ' OQPrint E Ninth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited '$ . ' OQPrint E Tenth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' , . ' OQPrint E Eleventh 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' , . ' OQPrint E Twelvth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' -' OQPrint E Thirteenth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' CR' OQPrint E Fourteenth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited ' Negative' OQPrint E Fifteenth 1 O 15 'UnEdited: ' O PhoneBefore O 45 'Edited: ' O PhoneAfter ' - - ' OQPrint E Sixteenth 1 O 15 'UnEdited: ' O PhoneBefore O 45 'Edited: ' O PhoneAfter '0AREA& &NO.& - ' OQPrint E Seventeent 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited '$ &DOLLARS& &CTS' OQPrint E Eighteenth 1 O 15 'UnEdited: ' O UnEdited O 45 'Edited: ' O Edited '$ &DOLLARS& &CTS'
select; when $AmountVar > 0; %editc( $AmountVar : '1' : '+') ; when $AmountVar < 0; %editc( $AmountVar : '1' : '-') ; when $AmountVar = 0; %editc( $AmountVar : '1' ); endsl;
Comment