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
 

 

Diff b/w variables in file section and work storage section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
venosol
Warnings : 1

New User


Joined: 16 Nov 2006
Posts: 43
Location: Bangalore

PostPosted: Thu Mar 15, 2007 4:42 pm    Post subject: Diff b/w variables in file section and work storage section
Reply with quote

What is the difference between defining variables in File section and work storage section ?

Thanks and regards
venugopalreddy
Back to top
View user's profile Send private message

cooldebi

New User


Joined: 19 Apr 2006
Posts: 18
Location: mumbai

PostPosted: Thu Mar 15, 2007 4:58 pm    Post subject: Re: Diff b/w variables in file section and work storage sect
Reply with quote

File-section --> Used to declare properties of a file and records declarations related to the file.

Working storage sections defines all the general variables which are going to be used by the program or by the subroutines called by the program till the program is active in the memory used by CPU.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Thu Mar 15, 2007 5:30 pm    Post subject:
Reply with quote

Here's a primary difference between a data field (in a record) in the FILE section and one in WORKING STORAGE.

If I MOVE values to a record area, then WRITE the record, due to buffering, the internally maintained record pointer is now pointing elsewhere in that file's buffer area, so if I try to reference one of the last written record's fields, or otherwise assume it has retained the value I MOVEd there, it won't have what I MOVEd there.

For this reason, many programmers use a corresponding WORKING STORAGE record area as well, then do the WRITE...FROM verb. This WORKING STORAGE area will retain its values after the WRITE. This is esp. useful if certain values are to be retained for consecutive WRITEs.
Back to top
View user's profile Send private message
venosol
Warnings : 1

New User


Joined: 16 Nov 2006
Posts: 43
Location: Bangalore

PostPosted: Fri Mar 16, 2007 12:53 pm    Post subject:
Reply with quote

Now I got idea.

Thanks a lot.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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