Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Difference between VALUE and INIT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Difference between VALUE and INIT
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    Post subject: Re: Difference between VALUE and INIT
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    Post subject: Re: Difference between VALUE and INIT
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Released Init 0 Yolanda Harvey All Other Mainframe Topics 13 Thu Aug 11, 2016 8:51 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us