IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What would be your first approach after getting -805


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pradeepsamson

New User


Joined: 08 Mar 2005
Posts: 5
Location: Pune

PostPosted: Wed Jun 14, 2006 4:42 pm
Reply with quote

Hi,

1) In JCL sort card sum fields = none for eliminating duplicates. How can I retrieve only duplicates?
2) How will you make sure that your SELECT query retrieves only one row always?
3) DISTINCT is used for eliminating duplicate rows in DB2. How can retrieve all the duplicates (A sample query is highly appreciated)?
4) I have a sort requirement like 5 records. In that 4 are same and 1 is different. I want to get only that 1 record. How? Anyone have an idea about "EQUALS" in sort card?
5) What would be your first approach after getting -805?
6) How can I know my particular program is using particular "PLAN"?
8)I have written program, ?PROGRAM-ID. ADD. Saved this particular program in a PDS as member name TEST. Will it work or throw any error?
9) I am compiling a COBOL db2 program suddenly my Db2 brought down what will happen?
10) What is Z-OS?

Cheers!
Pradeep Samson.
Back to top
View user's profile Send private message
philipraju
Warnings : 1

New User


Joined: 16 Apr 2006
Posts: 29

PostPosted: Wed Jun 14, 2006 8:37 pm
Reply with quote

In JCL sort card sum fields = none for eliminating duplicates. How can I retrieve only duplicates?

it will possible by the icetool
//toolin dd *
select from(in) to(dups) on(1,6,ch) alldups discard(nondups)
/*
dups--duplicate elements
nondups--non duplicate elements

2) How will you make sure that your SELECT query retrieves only one row always?
it will possible by the cursor
exec sql declare x cursor
select empname,emp from emp1 where city="london";
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Thu Jun 15, 2006 9:52 am
Reply with quote

hi

5) What would be your first approach after getting -805?

well this error comes when there is mismatch b/w the Load of a prog. and the bind of the prog .

so its better to check whether which load module u r using in ur job ., along with which plan u r using .

or if u r not certain abt the load module.

better do a compile bind again .

i hope it should a bit clearer now
if still hav doubts then plz do tell me .

Thanks ,
Kapil.
Back to top
View user's profile Send private message
Jerry

New User


Joined: 16 Sep 2005
Posts: 42

PostPosted: Thu Jun 15, 2006 6:51 pm
Reply with quote

Hi Pradeep,

1) In JCL sort card sum fields = none for eliminating duplicates. How can I retrieve only duplicates?

You could use SORTXSUM dataset and XSUM option in SUM FIELDS.

2) How will you make sure that your SELECT query retrieves only one row always?
Using primary key in the where statement of the select would give only one row.

3) DISTINCT is used for eliminating duplicate rows in DB2. How can retrieve all the duplicates (A sample query is highly appreciated)?

select col1 from tbname where count(col1) > 1;


4) I have a sort requirement like 5 records. In that 4 are same and 1 is different. I want to get only that 1 record. How?
Using sum fields = none in sort.

Anyone have an idea about "EQUALS" in sort card?
INCLUDE COND=(1,2,CH,EQ,C'AB?), would take only records with ?AB? in the first two positions in the input file.

5) What would be your first approach after getting -805?

One of my manual says:

Bind the program 'program name' as the member part of the application plan 'plan name' or * Correct the collection id in the PKLIST and bind the application plan 'plan name' or * Set the current package set special register correctly or * Put the correct 'location name' in the CURRENTSERVER of the BIND command and bind the application plan 'plan name' or * Connect to the correct RDB name or * Correct the location id in the PKLIST and bind the application plan 'plan name' or * Bind the DBRM of the version of the application program to be executed

6) How can I know my particular program is using particular "PLAN"?
sysibm.syplan would have the data.

Here is a sample JCL for sort:

//SORT1 EXEC PGM=SORT
//SORTIN DD DSN=XXX.YYY.ZZZ,DISP=SHR
//SORTOUT DD DSN=AAA.BBB.CCC,DISP=SHR - has distinct data?.
//SORTXSUM DD DSN=AAA.BBB.CCC1,DISP=SHR - has duplicates alone
//SORTWK01 DD UNIT=WORK,SPACE=(CYL,(200,50))
//SORTWK02 DD UNIT=WORK,SPACE=(CYL,(200,50))
//SORTWK03 DD UNIT=WORK,SPACE=(CYL,(200,50))
//SORTWK04 DD UNIT=WORK,SPACE=(CYL,(200,50))
//SORTWK05 DD UNIT=WORK,SPACE=(CYL,(200,50))
//SYSOUT DD SYSOUT=*
//SYSOUD DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=NONE,XSUM
//


Regards,
Jerry.
Back to top
View user's profile Send private message
subramanyamg5

New User


Joined: 13 Jun 2006
Posts: 5

PostPosted: Fri Jun 16, 2006 2:09 pm
Reply with quote

Hi Pradeep,

For second question while declaring the cursor you can give for fetch 1 row only.

ex: declare cursor x for select y,z from emp where x=y for fecth 1 row only.
this serves the purpose.

for eighth when the program name in pds and the id if they are not same then i think it will give an error.

for ninth question DB2 is not required to be UP while the compiling is done.

for tenth question Z/OS is the operating system which is an advanced one
like MVS.

third question is not clear as if you execute the query without distinct it will serve the purpose or you can change it to select all.

The remaining answers which Jerry has given are correct.
Back to top
View user's profile Send private message
muralithirumalaisamy
Warnings : 1

New User


Joined: 13 Jun 2005
Posts: 12
Location: chennai

PostPosted: Wed Sep 20, 2006 12:12 pm
Reply with quote

9) I am compiling a COBOL db2 program suddenly my Db2 brought down what will happen?


Hi pradeep!

Regarding The above Question. U will get "DB2 CONNECTION INTERNAL ERROR" and the error number is "-924"
Back to top
View user's profile Send private message
go2vvs

New User


Joined: 10 Jun 2006
Posts: 1

PostPosted: Tue Nov 14, 2006 10:27 am
Reply with quote

muralithirumalaisamy wrote:
9) I am compiling a COBOL db2 program suddenly my Db2 brought down what will happen?


Hi pradeep!

Regarding The above Question. U will get "DB2 CONNECTION INTERNAL ERROR" and the error number is "-924"



HI

During compilation process it will check whether all the columns in the sql statements are present in Dclgen or not.
During compilation it will not check DB2 system Catlogues(sysibm.syscolumns).
At compilation time Db2 is not at all required.
During Bind process it will check as per DB2 Tables

for example :
you can use a column in sql statement which does not exist in Db2 at all.
but it should be Dclgen....thats it .....
your compilation job will be fine
but your bind job fails
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Cobol-DB2 Programming - Better perfor... DB2 1
No new posts Need an opinion on the approach that ... CLIST & REXX 15
No new posts Need better approach to create a sort... DFSORT/ICETOOL 8
No new posts Introducing Commits to batch programs... DB2 10
No new posts Need help on Best approach for IMS Ke... IMS DB/DC 1
Search our Forums:

Back to Top