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

How to declare a workfile in working storage section


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

New User


Joined: 22 Jul 2010
Posts: 7
Location: Chennnai

PostPosted: Fri Jul 23, 2010 12:09 pm
Reply with quote

Can anyone please tell me how to declare a workfile in working storage section?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 23, 2010 12:20 pm
Reply with quote

Define workfile ............. is it a temporary file or what ?
Back to top
View user's profile Send private message
ArchanaAbhinay

New User


Joined: 22 Jul 2010
Posts: 7
Location: Chennnai

PostPosted: Fri Jul 23, 2010 12:24 pm
Reply with quote

ya..it is a temporary file.
I want to write some data to a flat file.
so instaed of directly writing into the file i want to write it first to a workfile and then to flat file.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 23, 2010 12:26 pm
Reply with quote

So i understand the workfile is NOT a flat file.
Back to top
View user's profile Send private message
ArchanaAbhinay

New User


Joined: 22 Jul 2010
Posts: 7
Location: Chennnai

PostPosted: Fri Jul 23, 2010 12:28 pm
Reply with quote

it should be a flat file.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 23, 2010 12:33 pm
Reply with quote

So define the workfile as you would do for the flatfile.
Back to top
View user's profile Send private message
Manny5

New User


Joined: 10 Nov 2008
Posts: 12
Location: Pune

PostPosted: Fri Jul 23, 2010 12:44 pm
Reply with quote

Well I am not sure what is your requirement. If you could share that if will make more sense and there could be a better way of doing things.

Else i am with Peter. If its a FB you may like to put into array for less number of records and do manipulation if needed.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 23, 2010 12:50 pm
Reply with quote

in cobol arrays are called cobol internal tables. arrays belong to other languages. java, c; db2 host variable arrays.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 23, 2010 1:00 pm
Reply with quote

ArchanaAbhinay wrote:
ya..it is a temporary file.
I want to write some data to a flat file.
so instaed of directly writing into the file i want to write it first to a workfile and then to flat file.
So why do you want to write it out twice, with once being to a file that gets deleted.

Perhaps if you made the effort to give some detail of exactly what it is that you wish to accomplish then maybe the COBOL wizards will tell you either how to do this, or suggest a much better way in which to accomplish your task.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 23, 2010 1:35 pm
Reply with quote

I realize that this is trivial,
but files are not defined in working-storage.

but ignorance of the programming language
has not prevented these kind of questions in the past,
nor, probably in the future.

echoing expat's comment:
this sounds like another example of a solution looking for a problem,
especially since the TS has not bothered to elaborate.
Back to top
View user's profile Send private message
ArchanaAbhinay

New User


Joined: 22 Jul 2010
Posts: 7
Location: Chennnai

PostPosted: Fri Jul 23, 2010 2:39 pm
Reply with quote

i solved my problem by just declaring a record having all the values which are liked to be moved.
and then moving them to the file.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Jul 23, 2010 2:45 pm
Reply with quote

OK, I am not a programmer, but why do you want to write them once and then again to a different file. Why write them twice when once will suffice. Unless of course you have just purchased a few shares in Big Blue.
Back to top
View user's profile Send private message
ArchanaAbhinay

New User


Joined: 22 Jul 2010
Posts: 7
Location: Chennnai

PostPosted: Fri Jul 23, 2010 2:54 pm
Reply with quote

No..the actual problem is i am getting some garbage values in the output.
so to sort it out i tried with temporary file.
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 CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top