Great idea to avoid the division. Hopefully the COBOL compiler would be intelligent enough to do an SRP instead of a DP to get rid of the extra digit.
On Wed, Jul 24, 2013 at 9:54 AM, Bernd Oppolzer <[email protected]>wrote: > John, thanks for the COBOL code; my COBOL experience dates from > the 90s, so I'm not very good in providing COBOL source examples. > > Yes, I think, this will be ok for 6 digit unsigned packed, giving a 7 digit > signed result. > > Things can be made a little easier if you define the overlaying field > (called NORMAL_PACKED in this case) having one digit after the > decimal point; then it does not have to be divided by 10 to get the > desired value. > > (in PL/1 this would be: DCL NORMAL_PACKED DEC FIXED (7,1); > don't know the correct syntax for COBOL). > > I even don't know PACKED-DECIMAL; in my times we called it > USAGE COMP-3. > > Kind regards > > Bernd > > > > Am 24.07.2013 16:21, schrieb Ron Thomas: > > Thank John for the explantion. so if suppose it is 9(05) then is the >> below correct? >> >> 01 UNSIGNED-PACKED-TIMES-10. >> 05 UNSIGNED-PACKED PIC X(3). >> 05 FILLER PIC X VALUE IS X'0F'. >> 01 NORMAL-PACKED REDEFINES UNSIGNED-PACKED-TIMES-10 PIC S9(7) >> PACKED-DECIMAL. >> 01 NORMAL-UNPACKED PIC 9(5) USAGE DISPLAY. >> >> >> Thanks, >> Ron T >> >> >> >> ------------------------------**------------------------------** >> ---------- >> For IBM-MAIN subscribe / signoff / archive access instructions, >> send email to [email protected] with the message: INFO IBM-MAIN >> >> > ------------------------------**------------------------------**---------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > -- This is a test of the Emergency Broadcast System. If this had been an actual emergency, do you really think we'd stick around to tell you? Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
