|
What is the problem with C eval wwRetVal = %trim(%EditC(CharNum:'3')) ?? Won't this do exactly the same job? Use editcode N if you want the minus sign on the left. --------------------------------------------------------- Booth Martin http://www.MartinVT.com Booth@xxxxxxxxxxxx --------------------------------------------------------- -------Original Message------- From: RPG programming on the AS400 / iSeries Date: Wednesday, July 30, 2003 7:23:36 AM To: rpg400-l@xxxxxxxxxxxx Subject: RV: Converting Packed to Char. RE: RPGIV: Converting Packed to Char.Well... i already did what i needed using the ugly approach that wanted to avoid: here's my proc. P CharNum B D CharNum PI 30A varying D peNumber 30S 9 value D peSize 10I 0 value D peDecPos 10I 0 value D wwRetVal s 30A varying d ds D NUM_P_0 1 15P 0 D NUM_P_1 1 15P 1 D NUM_P_2 1 15P 2 D NUM_P_3 1 15P 3 D NUM_P_4 1 15P 4 D NUM_P_5 1 15P 5 D NUM_P_6 1 15P 6 D NUM_P_7 1 15P 7 D NUM_P_8 1 15P 8 D NUM_P_9 1 15P 9 D CHAR_NUM 1 15A c select c when peDecPos = 0 c eval num_p_0 = peNumber c when peDecPos = 1 c eval num_p_1 = peNumber c when peDecPos = 2 c eval num_p_2 = peNumber c when peDecPos = 3 c eval num_p_3 = peNumber c when peDecPos = 4 c eval num_p_4 = peNumber c when peDecPos = 5 c eval num_p_5 = peNumber c when peDecPos = 6 c eval num_p_6 = peNumber c when peDecPos = 7 c eval num_p_7 = peNumber c when peDecPos = 8 c eval num_p_8 = peNumber c when peDecPos = 9 c eval num_p_9 = peNumber c endsl c eval wwRetVal = %subst(CHAR_NUM: c %int(peSize / 2 + 1)) c return wwRetVal P E Any ideas to improve it ? _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. .
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.