View previous topic :: View next topic
|
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 |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 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
Active User
Joined: 23 Feb 2006 Posts: 305 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: 8797 Location: Welsh Wales
|
|
|
|
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
Active User
Joined: 06 Sep 2007 Posts: 275 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
Active User
Joined: 06 Sep 2007 Posts: 275 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
Active User
Joined: 23 Feb 2006 Posts: 305 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
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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: 305 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
Active User
Joined: 06 Sep 2007 Posts: 275 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
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Dick,
Thank you very much. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
d |
|
Back to top |
|
|
jyothimenon1
New User
Joined: 16 Jul 2008 Posts: 9 Location: bangalore
|
|
|
|
here what will happen?
I have a doubt regarding open a file in one program and use it in its called program
Consider the scenario where I read 10 records from the file using the main program and if I gave a read in the called program then will I get the 11th record or the first record? (Here Im talking about the case that we are not carrying any key info from the main program to the sub program) |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
jyothimenon1 wrote: |
..I gave a read in the called program then will I get the 11th record or the first record? |
Do you open it in CALLed program as well..?... |
|
Back to top |
|
|
jyothimenon1
New User
Joined: 16 Jul 2008 Posts: 9 Location: bangalore
|
|
|
|
yes. reading 10 records in calling program then calling a program( called program) trying to read the same file. will it read from 11 th record or from first record |
|
Back to top |
|
|
|