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

Answers were Sorted based on User's Feedback



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

Answer / krishna

Move the sting in to a variable Eg to WS-String
then

Move 'a' to ws-string(4:1)

hope this will work

Is This Answer Correct ?    16 Yes 0 No

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

Answer / 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

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

Answer / deepak dada, jaipur

not sure but

inspect string replacing string(4:1) by 'a'


might work

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More JCL Interview Questions

File1 has 100 records and file2 has 200 records i want to copy 50 records which r in both file into file3

7 Answers  


How to get the last but one duplicate record of the file using Sort?

2 Answers   Fidelity,


WORKING-STORAGE SECTION. 01 GROSS-PAY. 05 BASIC-PAY PIC 9(5). 05 ALLOWENCES PIC 9(3). PROCEDURE DIVISION. MOVE 1000 TO BASIC-PAY. MOVE 250 TO ALLOWENCES. DISPLAY GROSS-PAY. STOP RUN. 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VLAUE 123.45 after the statement MOVE W-A TO W-B what will be W-B's value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

0 Answers  


how would you create a temporary dataset? And where will you use them?

0 Answers  


i created one base gdg with lrecl = 100 , now i need to create versions with different lrecl =150,200 can it be possible to create like tht ?

1 Answers   Patni, Syntel,


We can use PASS with permanent datasets also. THEN Which is the condition in which we may use PASS (instead of KEEP) with permanent data sets, while there is no need to specify UNIT and VOL for them like temporary data sets (in cas we use KEEP for permanent data sets) ?

0 Answers   IBM,


TIME parameter in JOB statement or EXEC statement specifies What type of time (CPU time or execution time)?

5 Answers   CTS,


how can we pass parameters from JCL to cobol subprogram...my requirement is i should not get data from mainprogram but i need it from JCL directly

5 Answers   IBM, TCS,


hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u

0 Answers   HF, iNautix,


What are the differences between JES2 & JES3 ?

4 Answers  


What is concatenating?

0 Answers  


How do you designate a comment in JCL?

1 Answers  


Categories