|
|
| Author |
Message |
devidas-patil Warnings : 1 Active User
Joined: 08 Jan 2007 Posts: 54 Location: pune
|
|
|
|
Hi all
i have two file and i want to use both the file in the cobol program and both file have the same attribute as well as the same FD entires but allowed me to use only one SELECT INFILE ASSIGN TO DDNAME
i cant
---> use two select statement in my program and
--> i cant merge two file,
--> i can't concatenate two file
what to do in this situation?
please let me know. |
|
| Back to top |
|
 |
References
|
|
 |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1478 Location: Bangalore,India
|
|
|
|
Patil,
| Quote: |
--> i cant merge two file,
--> i can't concatenate two file |
Why cant? Is there any business reason for this. |
|
| Back to top |
|
 |
devidas-patil Warnings : 1 Active User
Joined: 08 Jan 2007 Posts: 54 Location: pune
|
|
|
|
hi murali
this is question of my interviews so oi told him this two option but he was expecting something different than this |
|
| Back to top |
|
 |
Devzee
Senior Member
Joined: 20 Jan 2007 Posts: 708 Location: Hollywood
|
|
|
|
| Quote: |
--> cant use two select statement in my program and
--> i cant merge two file,
--> i can't concatenate two file |
Can you atleast execute the program twice with 2 diff files? |
|
| Back to top |
|
 |
Anuj D.
Global Moderator
Joined: 22 Apr 2006 Posts: 2154 Location: Phoenix, AZ
|
|
|
|
| devidas-patil wrote: |
Hi all
i have two file ...
|
I think the interviewer was talking about one input & one output.
| Quote: |
i cant
---> use two select statement in my program and
|
Under the above assumption, one can direct the output to SYSOUT dataset & one'll need only one SELECT statement in COBOL program.
| Quote: |
--> i cant merge two file,
--> i can't concatenate two file
what to do in this situation?
|
If Both the files are inputs.. then don't know.
Did you ask about the files usage !? If yes please let me know. Hopefully we can come up with some good idea. |
|
| Back to top |
|
 |
devidas-patil Warnings : 1 Active User
Joined: 08 Jan 2007 Posts: 54 Location: pune
|
|
|
|
Hi anuj
i not asked him about the file usage. i am very sure he was asking me both are the input file. |
|
| Back to top |
|
 |
Anuj D.
Global Moderator
Joined: 22 Apr 2006 Posts: 2154 Location: Phoenix, AZ
|
|
|
|
| devidas-patil wrote: |
Hi anuj
i not asked him about the file usage. i am very sure he was asking me both are the input file. |
Hi,
Every file used in COBOL program has to have a SELECT clause, so if both are inputs, then in this situation answer for the question is - not possible. |
|
| Back to top |
|
 |
Devzee
Senior Member
Joined: 20 Jan 2007 Posts: 708 Location: Hollywood
|
|
|
|
| Quote: |
| Every file used in COBOL program has to have a SELECT clause |
This is not true and cannot be generalized.
There is no need for SELECT statement in below COBOL code
- From COBOL you can open/close/read using assembler routintes without COBOL SELECT clause
- In IMS COBOL you can read files without COBOL SELECT clause
-In CICS COBOL program there is no need for COBOL SELECT clause |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8633 Location: 221 B Baker St
|
|
|
|
Hello,
You might run a step that copies/merges the 2 files into one before executing your program with these strange rules. . .  |
|
| Back to top |
|
 |
Anuj D.
Global Moderator
Joined: 22 Apr 2006 Posts: 2154 Location: Phoenix, AZ
|
|
|
|
Hi,
I hope interviewer asked about simple COBOL-batch program, by simple I mean a program which is not using any database. From the window of original question I think I didn't direct the OP in wrong direction.
However, if you can provide some examples or can direct to some link, that would be great to understand your statements rather better.
| dick scherrer wrote: |
Hello,
You might run a step that copies/merges the 2 files into one before executing your program with these strange rules. . .  |
Dick,
I didn't get your intention here..!? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8633 Location: 221 B Baker St
|
|
|
|
Hi Anuj,
If the files were combined prior to the COBOL program, the rather non-business "rules" of the question (can't use 2 . . .etc in the COBOL program) might be met.
I just took that work out of the COBOL code to satisfy the "rules" - probably not the best way to approach this, but keeps the 3 "can't"s out of COBOL
There is always the chance that what the interviewer meant to ask and what was understood to be the requirement was not the same. . . Happens quite often when you combine an interviewer with limited technical knowldege with an interviewee with limited experience and especially if they are communicating in a language that is not the "main" language of either one. |
|
| Back to top |
|
 |
Anuj D.
Global Moderator
Joined: 22 Apr 2006 Posts: 2154 Location: Phoenix, AZ
|
|
|
|
Still bounced..!
Let's leave it.  |
|
| Back to top |
|
 |
utkarshtewari
New User
Joined: 26 Mar 2007 Posts: 6 Location: Pune
|
|
|
|
Hi Anuj,
Guess what dick is suggesting is that in RUN JCL we need to put a step to merge/sort the two files into one, using Utilities...thus creating a single file to be dealt with in the program...
and in the next JCL step you can execute the program. |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 8633 Location: 221 B Baker St
|
|
|
|
Yup, not a way i'd do it if i had the need to process those files, but might get around the non-business requirement mentioned above.
I am fairly sure there is no business reason for the restrictons. . .  |
|
| Back to top |
|
 |
Anuj D.
Global Moderator
Joined: 22 Apr 2006 Posts: 2154 Location: Phoenix, AZ
|
|
|
|
Thanks Utkarsh.
| dick scherrer wrote: |
I am fairly sure there is no business reason for the restrictons. . .  |
Yeah, I do agree. |
|
| Back to top |
|
 |
|
|