View previous topic :: View next topic
|
Author |
Message |
MSMITHUK
New User
Joined: 31 Mar 2005 Posts: 5 Location: London
|
|
|
|
I have read the Language Reference manual but am still not clear.
Can anyone help with an explanation of the difference between using INIT to set the value of a variable and using VALUE.
Thanks in advance,
M |
|
Back to top |
|
|
sri.mainframes
New User
Joined: 16 Feb 2006 Posts: 29 Location: MUMBAI
|
|
|
|
hi ,
init is used in pl/1 to assign the value to the variables
value is used in cobol to assign value to the variavles
in cobol initilize means numeric variables set to zeros
and character variables set to spaces
Regards
Prince |
|
Back to top |
|
|
karnatikalyan
New User
Joined: 08 Feb 2006 Posts: 5
|
|
|
|
Hi,
I can tell you with an example of char data type.
for char data type the default length is 1. But if you use VALUE, you can assign a string of length morethan 1
For example:-
DCL NAME CHAR INIT('N'); Here the defualt lengh of name is 1 so you can not assign any string that has a lengh morethan 1
But
DC NAME CHAR VALUE('ASDASDSDDASDASDAS'); Though the default lengh is 1, still NAME can be assigned with a string that has length morethan one. NAME can be assigned with any length of chars.
If you have better idea about this please let me know.
Regards,
Karnati kalyan. |
|
Back to top |
|
|
MSMITHUK
New User
Joined: 31 Mar 2005 Posts: 5 Location: London
|
|
|
|
I have also found that when using the keyword VALUE to initialise a variable then the contents of that variable can NOT be changed within the program.
Cheers,
Moira |
|
Back to top |
|
|
|