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

Doudt Regarding Linkage Variables.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Sep 20, 2006 10:45 am
Reply with quote

Hi,

I have a doudt regarding the Variable passing from a main standalone progam to a sub routine.

There was a copy book in the Working storage of the main program. All the variables in the copybook have a "VALUE" clause.

There was a process to manipulates these variables in the main program before a call to the sub program

In the linkage section of the sub routine, the same copybook is present with the same 'VALUE' clause.

My doudt is ..what values does the copybook variables will have. Is that what the 'VALUED' clause declared in the linkage copybbok or the values pased thru the main program.

~Vamsi
Back to top
View user's profile Send private message
sarunkumaar

New User


Joined: 31 Aug 2006
Posts: 15
Location: Chennai, India

PostPosted: Wed Sep 20, 2006 11:12 am
Reply with quote

Hi,

It will have the values passed thru the main program.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Sep 20, 2006 11:24 am
Reply with quote

Hi,

I also think it will contain manipulated valuesmeans the value which is passed by main pgm.
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Sep 20, 2006 11:34 am
Reply with quote

hi guptae/sarun,

Giving Value clause for a variable means Initialization.
I couldn't map ......the reason y the values from main program where passed to sub routine
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Sep 20, 2006 11:44 am
Reply with quote

Hi Vamsi,

I think the value passed by the program will override the value which is give in linkage section
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Sep 20, 2006 11:55 am
Reply with quote

Hi Vasmi,

Value clause format :-



Format 1

--------

VALUE {IS} literal



Format 2

--------

88 condition-name VALUE/VALUES {IS/ARE}

literal1 {THROUGH/THRU} literal2



You should not give a value clause of format 1 type for a variable in Linkage section. Only Format 2 VALUE clauses may be coded in the FILE and LINKAGE SECTIONS. As an IBM extension, Format 1 VALUE clauses coded in the FILE and LINKAGE SECTIONS are treated as comments.

This link will be useful:
www.helsinki.fi/atk/unix/dec_manuals/cobv27ua/cobrm_016.htm
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Sep 20, 2006 12:12 pm
Reply with quote

Thanks Ekta.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts JCL with variables JCL & VSAM 1
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts OPTLINK linkage convention PL/I & Assembler 3
Search our Forums:

Back to Top