How to covert given string into ASCII value in COBOL/MF
COBOL

Answer Posted / asmara

translate(Rtrim(Ltrim(substr(col_1,1,6))),'$',0123456789')
=''

thru leading (LTRIM) and Trailing (RTRIM) spaces from the
substring, then translates embedded spaces to $ and digits
to spaces and leaves any other char unchanged, then checks
to be sure there is nothing but spaces left. We can say
that we are checking the substring contains only numberic
digits, optionally with leading and/or trailing spaces.

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

677


What are 77 levels used for?

656


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

709


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

2728


What are the different rules for performing sort operation?

757






How do you define a variable of comp-1 and comp-2?

701


How to know whether the module is dynamical or statistical?

650


i want a program using by if, evaluate , string, unstring, perform, occurs?

4046


how to access the file from prodution from changeman tool and to submit a file to production

6680


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10578


Why occurs cannot be used in 01 level in COBOL?

711


How can you get the ksds file records into your cobol program?

639


IF I mention stop run in CICS what happens?

1891


What kind of error is trapped by on size error option?

738


how to refer the data field?

1802