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
 

 

How to declare a workfile in working storage section

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to declare a workfile in working storage section
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 12:20 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 23, 2010 12:26 pm    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 23, 2010 12:33 pm    Post subject:
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    Post subject: Reply to: How to declare a workfile in working storage secti
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 1:00 pm    Post subject:
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    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Jul 23, 2010 2:45 pm    Post subject:
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    Post subject:
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    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 SCRNAME not working on my mainframe? mrsidhu12 TSO/ISPF 7 Thu Sep 01, 2016 2:17 pm
No new posts 2 same CLIST pgm but with different n... boyti ko CLIST & REXX 5 Fri Jun 03, 2016 4:55 pm
No new posts REXX Screen not working due to LINKED... sundarkudos CLIST & REXX 1 Mon May 09, 2016 1:44 pm
No new posts Free FILE not working for specific users sankalp-goyal CLIST & REXX 12 Mon Apr 25, 2016 6:33 pm
No new posts How storage is calculated for AN-Edit... Raghu navaikulam COBOL Programming 2 Wed Mar 09, 2016 3:51 pm


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