unpack unsigned packed field in db2 unpack unsigned packed field in db2 gowster (Programmer) (OP) 14 Sep 12 13:56 Does any know if there is a way to unpack an unsigned column to an A/N field in DB2? RE: unpack unsigned packed field in db2 mikrom (Programmer) 14 Sep 12 15:33 I'm working with COBOL on DB2 and DECIMAL field in DB2 is signed packed field in COBOL. For example a field in DB2 table which is defined as DECIMAL(17,2) is defined in COBOL as S9(15)V99 COMP-3. I don't understand what you exactly mean with unsigned packed field. Show an example what you have and what you want to have. RE: unpack unsigned packed field in db2 gowster (Programmer) (OP) 14 Sep 12 16:05 An assembler program creates a file with unsigned packed numbers which is then uploaded to DB2 as as an A/N field. For example an account number will be represented as X'3899'. I want to unpack the field to '3899'. RE: unpack unsigned packed field in db2 papadba (MIS) 14 Sep 12 16:21 Post the "input" value (in hex) and the desired output value also in hex. Mention how many bytes are to be used for each value. X'3899' is Not a an unsigned packed number because by definition a packed decimal number has a sigh in the low-order nibble. Once you show what you "have" and what you "want" and we get the terminology straight, someone may have a suggestion. RE: unpack unsigned packed field in db2 MarcLodge (Programmer) 14 Sep 12 20:01 I would suggest posting this in the relevant language forum, as this does not seem to be a DB2 issue. It appears to me as if you are asking 'in such and such a language, how do I convert a xxxx field to a zzzzz field'. We are all happy to help, and have between us a pretty extensive knowledge of DB2 and numerous languages that interact with it, but I think you may need to be a little more specific with your question, or even post in a more relevant forum. Apologies for not being able to be overly helpful. Marc RE: unpack unsigned packed field in db2 gowster (Programmer) (OP) 14 Sep 12 20:08 Hello I have to re-state this situation, it involves an unsigned packed decimal number. These numbers can/are created in assembler. Is there a way, if anyone knows, for DB2 to unpack this type of numeric field? Does the new UNPACK function do this? I would like to do this without arithmetic. Again, there is such a thing a unsigned packed numbers. Thank you RE: unpack unsigned packed field in db2 fredericofonseca (IS/IT--Management) 15 Sep 12 13:28 look at the load utility - with that you can convert the field on the load - be aware though that you do need to define the field correctly - and if your assembler program is not following the normal storage rules then you will have big problems. It is also possible that it is not a packed decimal, but a binary format e.g. COMP or BINARY or COMP-5 for example. As some previously asked, if you wish to have a correct answer you need to supply more information, including source data and formatted data. Operating system and version of the software used are also, in many cases, a requirement for you to get the answer you seek. Regards Frederico Fonseca SysSoft Integrated Ltd www.syssoft-int.com FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions? FAQ181-2886: How can I maximize my chances of getting an answer? RE: unpack unsigned packed field in db2 papadba (MIS) 15 Sep 12 17:38 You still need to post the input value in Hex as well as the desired output in hex. "if your assembler program is not following the normal storage rules then you will have big problems."From what you have posted, this is indeed what you are working with. Once we know what you have as input and exactly what you want as output, there should be more usable suggestions.