View previous topic :: View next topic
|
Author |
Message |
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
1) I have a variable length of 10 characters with spaces inclusive .
How can I replace the spaces with '-' .
My answer :
-> We can do this using String functions in COBOL program (not sure which function name) .
-> We write a logic in COBOL program to replace the strings .
-> We can do the same with JCL (using SORT etc) .
Please let me know if answers were OK ?
2) I have a numeric variable of length 8 .
I am moving value '10' to it . How it will accomodate ?
My answer :
It will placed at the rightmost bits .
However we can format the placing using the format specifiers in COBOL .
Please let me know is correct answer ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
1. Not a string function but - INSPECT/REPLACING. There are STRING and UNSTRING functions, but they would not be good for this.
2. This would depend on the actual definition of the field. Suggest you use the link at the top of the page to "IBM Manuals" among which are several COBOL Language Reference documents. Read about moving to numeric fields. |
|
Back to top |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Thanks Dick !!! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|