View previous topic :: View next topic
|
Author |
Message |
trgk03
New User
Joined: 20 Jan 2006 Posts: 12 Location: kochi
|
|
|
|
HI ALL
In a single cobol program is it possible to write to 2 or more output file if yes how do i tell cobol in which file to write. |
|
Back to top |
|
|
raghunathns
Active User
Joined: 08 Dec 2005 Posts: 127 Location: rochester
|
|
|
|
declare
multiple select statements
multiple fd sections, under fd each one has one record.
when ever you write a perticular record it writes to perticular file. |
|
Back to top |
|
|
Pollyannaish
New User
Joined: 09 Jul 2005 Posts: 31 Location: Pune, India
|
|
|
|
Hi
I think raghunathns is right. You can write the records to as many files as you want.
Move the record to their corresponding RL's and write it as and when required.
Let me know if more information is needed. |
|
Back to top |
|
|
cevelavl
New User
Joined: 20 Feb 2006 Posts: 4
|
|
|
|
hi,
perhaps this expample will be useful for you:
Code: |
file-control.
select File-1 assign .. etc.
select File-2 assign .. etc.
file section.
fd File-1.
1 Rec-1 pic x(80).
fd File-2.
1 Rec-2 pic x(80).
..
procedure division.
open output File-1 File-2.
..
* writing of records
move "something .. " to Rec-1 Rec-2.
write Rec-1.
write Rec-2.
..
close File-1 File-2.
|
|
|
Back to top |
|
|
sonu_winks
New User
Joined: 23 Nov 2005 Posts: 23
|
|
|
|
u can write 3273 out put file since the maximum no of DD stmt has this restriction.hope my understanding is rite |
|
Back to top |
|
|
tksvv
New User
Joined: 17 Mar 2006 Posts: 6
|
|
|
|
The Select Clause can occur 65535 times in a cobol program. Theoritically the answer to your question is that you can have 65535 files in a cobol program.
There might be other limits as the JCL limits which I am not sure about. |
|
Back to top |
|
|
shivani_tech Warnings : 2 New User
Joined: 08 Jan 2006 Posts: 22 Location: UNITED KINGDOM
|
|
|
|
ya sonu is right
coz limitation in jcl must be considered so as to submit the job
thanks
shivani |
|
Back to top |
|
|
gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109
|
|
|
|
tksvv wrote: |
The Select Clause can occur 65535 times in a cobol program. Theoritically the answer to your question is that you can have 65535 files in a cobol program.
There might be other limits as the JCL limits which I am not sure about. |
hi can you please clarify us how do you say we can have 65535 select clause in a program. for a particular pgm executed through an EXEC statement, we can have 3273 DD statements. this means we can have only 3273 files.
please clarify me.
kind regards,
gowtham |
|
Back to top |
|
|
tksvv
New User
Joined: 17 Mar 2006 Posts: 6
|
|
|
|
Pls check the compiler Limits for COBOL. It will show that the number of Select clauses is 65535. So you can have that many files in a COBOL. (I checked in Quick reference which is a product of IBM).
I had already mentioned that I am not sure of JCL limits or any other limits which might make the above limit unrealistic.
Are all cobol programs executed thru JCL? What about Online programs. |
|
Back to top |
|
|
|