View previous topic :: View next topic
|
Author |
Message |
ArchanaAbhinay
New User
Joined: 22 Jul 2010 Posts: 7 Location: Chennnai
|
|
|
|
Can anyone please tell me how to declare a workfile in working storage section? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Define workfile ............. is it a temporary file or what ? |
|
Back to top |
|
|
ArchanaAbhinay
New User
Joined: 22 Jul 2010 Posts: 7 Location: Chennnai
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
So i understand the workfile is NOT a flat file. |
|
Back to top |
|
|
ArchanaAbhinay
New User
Joined: 22 Jul 2010 Posts: 7 Location: Chennnai
|
|
|
|
it should be a flat file. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
So define the workfile as you would do for the flatfile. |
|
Back to top |
|
|
Manny5
New User
Joined: 10 Nov 2008 Posts: 12 Location: Pune
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
in cobol arrays are called cobol internal tables. arrays belong to other languages. java, c; db2 host variable arrays. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
ArchanaAbhinay
New User
Joined: 22 Jul 2010 Posts: 7 Location: Chennnai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
ArchanaAbhinay
New User
Joined: 22 Jul 2010 Posts: 7 Location: Chennnai
|
|
|
|
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 |
|
|
|