Exemplary Info About How To Check For Spaces In Cobol
Cobol move statement move ws_count to my_data.
How to check for spaces in cobol. 1) using inspect fill all the spaces in your first field to some delimiter that you would not face in your data, for example, '~' 2) reverse the string using function for ex,. Blank 'b' can be used as if var = 'bbbbb'. After receiving the screen and interrogating the field, if the input screen field is <= spaces (blanks?????
Display 'count of leading spaces is = '. You could code as follows to check for less than or equal to spaces: Frequently used separators − space, comma, period, apostrophe, left/right parenthesis, and quotation mark.
You cannot check a comp variable for spaces, period. Your variable then contains spaces. You mentioned using function reverse followed by inspect.
So you can reverse the bytes in a. Do a inspect over your variable checking for ' ' if count is greater or equal to 1. Move ' inspect tallying depicted by mainframewizard.com'.
The cobol character set includes 78 characters which are shown below −. Inspect can count leading spaces, but not, by standard, trailing spaces.