i have a string of 80 chars i want to replace 4th char with "a"?

Answer Posted / mchava

first move string 4th position to one variable

ex: string(4:1)=ws-string

then use inspect and replace words
ex: INSPECT STRING REPLACING WS-STRING BY 'a'
BEFORE SPACE/'.'/(end of the sting).

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does jcl support automatic restart?

773


Explain the purpose of the dd keylen parameter?

691


How to execute 2nd and 4th steps among 5 steps in jcl proc?

757


I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.

1740


Is acct parameter mandatory?

768






what is the purpose of coding class parameter in job statement?

732


Can we use DISP=SHR in output file in JCL

961


What is the function of the dd avgrec keyword in sms datasets?

852


Are there any set of rules for the names of the steps used in a job? What are they?

624


Explain how can return codes be tested before execution of a job step?

841


when does a dataset go uncataloged?

845


what is the resolution for sb37 error

7738


Many jcl statements contain specific values designed to direct and control the execution of the statement. What are these fields called?

731


//S10 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=VAR.INPUT1,DISP=SHR // DD DSN=VAR.INPUT2,DISP=SHR //OUT DD DSN=VAR.OUTPUT,DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,5)),UNIT=SYSDA //TOOLIN DD * * Splice the needed data from the two VB files together SPLICE FROM(CON) TO(OUT) ON(5,5,CH) WITHALL - WITH(12,5) WITH(22,20) VLENMAX /*

925


i want to store 20 digits . how will u do it in cobol ?

870