Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Is there any way to use TWO files by a single SELECT
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions
Author Message
devidas-patil
Warnings : 1

Active User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed May 30, 2007 10:03 am    Post subject: Is there any way to use TWO files by a single SELECT
Reply with quote

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
View user's profile Send private message
References
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1478
Location: Bangalore,India

PostPosted: Wed May 30, 2007 10:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
devidas-patil
Warnings : 1

Active User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed May 30, 2007 10:44 am    Post subject:
Reply with quote

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
View user's profile Send private message
Devzee

Senior Member


Joined: 20 Jan 2007
Posts: 708
Location: Hollywood

PostPosted: Wed May 30, 2007 10:44 am    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2154
Location: Phoenix, AZ

PostPosted: Wed May 30, 2007 11:38 am    Post subject: Re: Is there any way to use TWO files by a single SELECT
Reply with quote

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
View user's profile Send private message
devidas-patil
Warnings : 1

Active User


Joined: 08 Jan 2007
Posts: 54
Location: pune

PostPosted: Wed May 30, 2007 2:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2154
Location: Phoenix, AZ

PostPosted: Thu Jun 07, 2007 8:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Devzee

Senior Member


Joined: 20 Jan 2007
Posts: 708
Location: Hollywood

PostPosted: Thu Jun 07, 2007 8:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8633
Location: 221 B Baker St

PostPosted: Thu Jun 07, 2007 9:08 pm    Post subject:
Reply with quote

Hello,

You might run a step that copies/merges the 2 files into one before executing your program with these strange rules. . . icon_smile.gif
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2154
Location: Phoenix, AZ

PostPosted: Fri Jun 08, 2007 7:40 pm    Post subject:
Reply with quote

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. . . icon_smile.gif


Dick,
I didn't get your intention here..!?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8633
Location: 221 B Baker St

PostPosted: Fri Jun 08, 2007 8:59 pm    Post subject:
Reply with quote

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 icon_confused.gif

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
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2154
Location: Phoenix, AZ

PostPosted: Mon Jun 11, 2007 9:28 pm    Post subject:
Reply with quote

Still bounced..!
Let's leave it. icon_neutral.gif
Back to top
View user's profile Send private message
utkarshtewari

New User


Joined: 26 Mar 2007
Posts: 6
Location: Pune

PostPosted: Fri Jun 15, 2007 2:13 pm    Post subject: Re: Is there any way to use TWO files by a single SELECT
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 8633
Location: 221 B Baker St

PostPosted: Sat Jun 16, 2007 5:02 am    Post subject:
Reply with quote

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. . . icon_confused.gif
Back to top
View user's profile Send private message
Anuj D.

Global Moderator


Joined: 22 Apr 2006
Posts: 2154
Location: Phoenix, AZ

PostPosted: Tue Jun 19, 2007 6:35 pm    Post subject:
Reply with quote

Thanks Utkarsh. icon_smile.gif

dick scherrer wrote:
I am fairly sure there is no business reason for the restrictons. . . icon_confused.gif


Yeah, I do agree.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Interview Questions All times are GMT + 6 HoursGoto page 1, 2  Next
Page 1 of 2