View previous topic :: View next topic
|
Author |
Message |
bubu505 Warnings : 1 New User
Joined: 03 Jan 2006 Posts: 5 Location: india
|
|
|
|
please help me to know what is reference modification. |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
Reference modification is a feature introduced in COBOL - II. Using this feature we can extract a part of data contained in alphanumeric or alphabetic variable.
For example:
If we have a following variable:
05 WS-DATE-VAR PIC X(10) VALUE '12/06/2006'.
05 WS-MONTH-VAR PIC 9(02).
and our requirement is to retrive month part of WS-DATE-VAR.
We can use:
MOVE WS-DATE-VAR(3:2) TO WS-MONTH-VAR.
Above code will move '06' to WS-MONTH-VAR. Reference modification is similar to SUBSTR() function found in most of the other programming languages.
Its syntax is : variable(start_char:no_of_chars) |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
You can also refer to link http://www.fluffycat.com/cobol/cobol-refer.html for more information. |
|
Back to top |
|
|
|