IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference between VALUE and INIT


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MSMITHUK

New User


Joined: 31 Mar 2005
Posts: 5
Location: London

PostPosted: Mon Apr 24, 2006 8:41 pm
Reply with quote

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
View user's profile Send private message
sri.mainframes

New User


Joined: 16 Feb 2006
Posts: 29
Location: MUMBAI

PostPosted: Thu Jun 22, 2006 3:57 pm
Reply with quote

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
View user's profile Send private message
karnatikalyan

New User


Joined: 08 Feb 2006
Posts: 5

PostPosted: Thu Jun 29, 2006 1:42 pm
Reply with quote

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
View user's profile Send private message
MSMITHUK

New User


Joined: 31 Mar 2005
Posts: 5
Location: London

PostPosted: Thu Jun 29, 2006 3:09 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Timestamp difference and its average ... DB2 11
No new posts Difference when accessing dataset in ... JCL & VSAM 7
No new posts What is the difference between Taskty... Compuware & Other Tools 2
No new posts Difference between VALIDPROC and CHEC... DB2 3
No new posts Difference between CEE3250C and CEE3204S COBOL Programming 2
Search our Forums:

Back to Top