|
|
| Author |
Message |
rakeshvp3 Currently Banned New User
Joined: 19 May 2008 Posts: 2 Location: bangalore
|
|
|
|
1. Is it possible to open and close a file in the calling program and to read the records of the file in the called program?
2. A JCL
//SYSIN DD DSN=A.B.C, disp= old
//SYSIN DD DSN=P.Q.R, disp=old
Will it concatenate or not?
3.How many files will be created while creating a table?
4.If two temperory datasets of the form DSN=&WORK and DSN=&&WORK in the job stream , will the system intercept it as a same dataset or different ? |
|
| Back to top |
|
 |
References
|
Posted: Wed May 28, 2008 11:08 am Post subject: Re: Open and close a file in the calling program |
 |
|
|
 |
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 169 Location: Bangalore
|
|
|
|
What files are you talking about?
When you create a DB2 table, the table is created under a TABLESPACE.
The & symbol is used to indicate the symbolic override. |
|
| Back to top |
|
 |
shreevamsi
Senior Member
Joined: 23 Feb 2006 Posts: 319 Location: Hyderabad,India
|
|
|
|
1. Yes you can open or close a file in a calling program and read or write in a called program
2. Concatination can be done by the following method only.
//SYSIN DD DSN=A.B.C, disp= old
// DD DSN=P.Q.R, disp=old
3. When we create a table, we won;t be explicitly create any files.
4. One is a Symbolic Parm and the other is a Temp dataset. There shouldn't be any problem.[/quote] |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2435 Location: Brussels once more ...
|
|
|
|
| Quote: |
2. A JCL
//SYSIN DD DSN=A.B.C, disp= old
//SYSIN DD DSN=P.Q.R, disp=old
Will it concatenate or not?
3.How many files will be created while creating a table?
|
2) Not concatenation, probably a JCL error
- should fail on disp= old (space present)
3) What type of table are you creating ?
DB2, ISPF, in storage ??? |
|
| Back to top |
|
 |
vasanthkumarhb
Senior Member
Joined: 06 Sep 2007 Posts: 300 Location: Bang,iflex
|
|
|
|
Hi,
| Quote: |
| 1. Is it possible to open and close a file in the calling program and to read the records of the file in the called program? |
Ans: If u want read in calling program and move it LIKAGE SECTION LN-REC (record structure) then u can make use of these variable data in called progam.
But according to your question opening and closing in calling program and reading in called program is not possible.
| Quote: |
2. A JCL
//SYSIN DD DSN=A.B.C, disp= old
//SYSIN DD DSN=P.Q.R, disp=old
Will it concatenate or not? |
Ans: No,it wil not concatenate.
| Quote: |
| 3.How many files will be created while creating a table? |
Ans: Ambigius Question......
| Quote: |
| 4.If two temperory datasets of the form DSN=&WORK and DSN=&&WORK in the job stream , will the system intercept it as a same dataset or different ? |
Ans: & is an symbolic override parameter as suggest before, also && indicates temporary data set, you can make use of it, i guess nothing to worry. |
|
| Back to top |
|
 |
vasanthkumarhb
Senior Member
Joined: 06 Sep 2007 Posts: 300 Location: Bang,iflex
|
|
|
|
Hi Vamsi
| shreevamsi wrote: |
| 1. Yes you can open or close a file in a calling program and read or write in a called program |
[/quote]
I felt quite intresting to your above answer, please give an example for the above answer. |
|
| Back to top |
|
 |
shreevamsi
Senior Member
Joined: 23 Feb 2006 Posts: 319 Location: Hyderabad,India
|
|
|
|
Hi Vasanth,
I use an generic program to open or close a particular file. The file holds the details of the No of records processed in the particular run.
The details are captured in the called program.
~Vamsi |
|
| Back to top |
|
 |
gcicchet
Active User
Joined: 28 Jul 2006 Posts: 295
|
|
|
|
Hi,
I know 1 & is not strictly correct but both & and && will give the same temporary dataset name.
Gerry |
|
| Back to top |
|
 |
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 173 Location: Deerfield IL
|
|
|
|
| vasanthkumarhb wrote: |
| 1. Yes you can open or close a file in a calling program and read or write in a called program |
| shreevamsi wrote: |
| I felt quite intresting to your above answer, please give an example for the above answer. |
This can be done with an "External" file.
Put the Select and FD statements in both the calling and the called program. The FD in both should contain the word "External".
Then open and close the file in the calling program as normal, and read or write the file as normal in the called program. |
|
| Back to top |
|
 |
vasanthkumarhb
Senior Member
Joined: 06 Sep 2007 Posts: 300 Location: Bang,iflex
|
|
|
|
Hi,
| Quote: |
| The FD in both should contain the word "External". |
Now i got the solution, i need to know, how FD can be declared as "EXTERNAL"? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6729 Location: 221 B Baker St
|
|
| Back to top |
|
 |
vasanthkumarhb
Senior Member
Joined: 06 Sep 2007 Posts: 300 Location: Bang,iflex
|
|
|
|
Hi Dick,
Thank you very much. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 6729 Location: 221 B Baker St
|
|
|
|
You're welcome
d |
|
| Back to top |
|
 |
|
|