Can i move alphanumeric to numeric in cobol




















That is not always true. Data comming from input aren't always numeric or alpha for certain. Someone could select something like xxxxxxx or or even xxxxx9x9. How would you deal with a situation like this? I think what hugheskbh asked for is a way to extracty only the numerals from a field, and not just check if it is numeric or not. RE: Converting alphanumeric field to numeric Also right, theotyflos.

But, this means that care should be taken to clearly ask questions on this forum. The fact that a one liner question can be interpreted in so many different ways indicates that the question was probably not well worded. My approach was to give a simple answer and encourage the questioner to pursue the issue and hopefully pinpoint the real answer they are after. Hopefully, with this technique, I won't lose them with a thorough and potentially disorienting answer. Red Flag This Post Please let us know here why this post is inappropriate.

Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework. The Tek-Tips staff will check this out and take appropriate action. The upper 4 bits, '4', are flipped to 'F' and the lower 4 bits are moved as they are.

This results in the least significant digit lsd containing 'F0' hex. This just happens to be the unsigned numeric representation for the digit '0' in a PIC 9 data item. The remaining leading digits are moved as they are ie. The net result is that FOO displays as b 0. This would flip their display characteristics from spaces to zeros. Final words Best not to have to know anything about this sort to thing.

Firstly, why do you think it might be useful to MOVE a byte field to a two-byte field? You are going to get a "certain amount! Do you know which part of your bytes is going to be truncated? I'd guess not. Those bytes are taken from the right of the alpha-numeric field. For an unsigned field which is a field with "no operational sign" a COBOL compiler should generate code to ensure that the field contains no sign.

The 2 or 4 of X'2n' or X'4n' is, without regard to its value, obliterated to the bit-pattern for an "unsign" the lack of an "operational sign". An "unsign" followed by a numeric digit which is the '0' left over from the space will, obviously, appear as a zero. If you had done that, you should find 1 followed by spaces for your first field as you would expect and space followed by zero for your second field, which you didn't expect.

And you should see what you "almost" expect. You probably want the leading zero as well the level-number 05 is an example, whatever level-number you are using will work.

This message would have been issued by the compiler:. The rightmost 18 characters were used as the sender. Even though it is a lowly "W" which only gives a Return Code of 4, not bothering to read it is not good practice, and if you had read it you'd not have needed to ask the question - although perhaps you'd still not know how you ended up with " 0", but that is another thing.

I gather you expect the 9 2 value to show up as "1" instead of "0" and you are confused as to why it does not? The edited numeric format is typically used to prepare or convert numeric data that is stored in a variety of formats into a format that is easily read by human beings or easily exported to a non Show more See Also : Free Converter Show details.

Jpg converter. Png converter. Gif converter. Tiff converter. Webp converter. Ico converter. Bmp converter. Pdf converter. Rtf converter. Csv converter. Word converter. Doc converter. Docx converter. Html converter. Odp converter. Odt converter. Ods converter. Ppt converter. Pptx converter. Ps converter. Txt converter. Xlsx converter. Xls converter. Xml converter.

Length converter. Weight converter. Temperature converter. Energy converter. Area converter. Epub converter. Mobi converter. Azw3 converter. Mp4 converter. Webm converter. Flv converter. Mkv converter. Avi converter. Mov converter. Wmv converter. Android video converter. Iphone video converter. Ipad video converter. Mobile video converter. When u r trying to do this there must be SOC7 Abend. Check that yourself When you use that numeric field in arithmatic or conditional expression then you will get S0C7.

Read the manual to get more information. Posted: Sat Mar 17, am. I had a similar problem in a large program in which I am installing a major upgrade.

I missed this in my analysis and went testing merrily along. Well, we use a PC-based development product called Microfocus MFE that comes fairly close to emulating the mainframe - except in this instance! MFE allowed me to move alphanumeric data to this field and use it in compares without an abend.

Oh, Calcutta!



0コメント

  • 1000 / 1000