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

Tesco Interview Questions


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

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Tue Nov 15, 2005 12:33 pm
Reply with quote

Hi Friends,

One of my friend has faced the foll Question in Tesco.

1. A Cobol-DB2 Program is calling another program which is also a Cobol+DB2 Program. First u will be compling and then u will bind it.
During exection how will u give the Plan Name that is will u mention for both the program if it i how will u mention it?

2. In a Cobol+ DB2 program I have changed the Cobol codings. Should i need to bind the program again? If i am going to change the SQL codings
what i have to do? How to do REBIND?

3. During Impact analysis i have changed the field from 9(3) to 9(6).
Now the values will be as 000123. I want to change this zero into space.
How will u do it using DB2?

4. Which is best COBOL Sorting or JCL Sorting? How will u evaluate this?

Friends please response for this queries.

Thanks and Regards,
Suganthyprabha.
Back to top
View user's profile Send private message
sanya9

New User


Joined: 05 Sep 2005
Posts: 13

PostPosted: Tue Nov 15, 2005 1:04 pm
Reply with quote

Hi Suganth,


1. In a Cobol+ DB2 program I have changed the Cobol codings. Should i need to bind the program again? If i am going to change the SQL codings
what i have to do? How to do REBIND?

yes! u've rebind the program.cos,if u change anything cobol & DB2 that vll affect in timesatmp tokens.so,if time stamp mismatches u'll get error -818 sql code error.
after chaning ur cobol code,in compilation ,precomiplation process load module vll create & in other side in binding process ,plan timestamp vll create.so,if u've to rebind program.if u not rebind the program u'll get
SQL error code -818.

3. During Impact analysis i have changed the field from 9(3) to 9(6).
Now the values will be as 000123. I want to change this zero into space.
How will u do it using DB2?

u can use through cobol move statements

4. Which is best COBOL Sorting or JCL Sorting? How will u evaluate this?

can sort the any data in JCL what data u want,but in cobol u can't sort that particular data.it is possible in input & output procedure

if any mistakes in my answers..pls be clarify
Regards,
Kiran.
Back to top
View user's profile Send private message
sanya9

New User


Joined: 05 Sep 2005
Posts: 13

PostPosted: Tue Nov 15, 2005 1:05 pm
Reply with quote

Hi Suganth,


1. In a Cobol+ DB2 program I have changed the Cobol codings. Should i need to bind the program again? If i am going to change the SQL codings
what i have to do? How to do REBIND?

yes! u've rebind the program.cos,if u change anything cobol & DB2 that vll affect in timesatmp tokens.so,if time stamp mismatches u'll get error -818 sql code error.
after chaning ur cobol code,in compilation ,precomiplation process load module vll create & in other side in binding process ,plan timestamp vll create.so,if u've to rebind program.if u not rebind the program u'll get
SQL error code -818.

3. During Impact analysis i have changed the field from 9(3) to 9(6).
Now the values will be as 000123. I want to change this zero into space.
How will u do it using DB2?

u can use through cobol move statements

4. Which is best COBOL Sorting or JCL Sorting? How will u evaluate this?

u sort any data in JCL what data u want,but in cobol u can't sort that particular data.it is possible in input & output procedure

if any mistakes in my answers..pls be clarify
Regards,
Kiran.
Back to top
View user's profile Send private message
suganthyprabha

New User


Joined: 28 Jul 2005
Posts: 58

PostPosted: Tue Nov 15, 2005 2:27 pm
Reply with quote

Hi Kiran,

Thanks for ur Reply. Can u guys answer me for the First Question?

Thanks and Regards,
Suganthyprabha.
Back to top
View user's profile Send private message
hanu_010

New User


Joined: 25 Jan 2007
Posts: 9
Location: hyd

PostPosted: Mon Mar 05, 2007 6:20 pm
Reply with quote

. A Cobol-DB2 Program is calling another program which is also a Cobol+DB2 Program. First u will be compling and then u will bind it.
During exection how will u give the Plan Name that is will u mention for both the program if it i how will u mention it?


AT THE TIME OF PRECOMPILATION

PRECOMPLIRE GENRATE DBRMS FOR EVERY CALL PROGRAMS

SUPPOSE


MAINPROGRAM CALL N SUBPROGRAMS

PRECOMPILRE GENERATE N+1 DBRAMS

SO THESE N+1 DBRMS TAKES BIND AS INPUT AND GENERATE SINGLE PLAN

SO NO NEED MENTIONED SUBPROGRAM PALN IN RUN TIME


BIND PLAN(PALN NAME)
PKLIST(COLL1,*) PKLIST MEANS WE GROUP THE N+1 DBRMS TRAET AS ONE COLLECTION ID AND IT IS MENTIONED IN BIND PLAN

BIND TAKES COLLECTION ID GENRATE ONE SINGLE PLAN FOR ENTIRE PRORAM

PLEASE GIVE ME RESPONSE IF ANY WRONG IN THERE
Back to top
View user's profile Send private message
hanu_010

New User


Joined: 25 Jan 2007
Posts: 9
Location: hyd

PostPosted: Mon Mar 05, 2007 6:23 pm
Reply with quote

2

IF YOU CHANGED COBOL PROGRAM YOU SHOULD PRECOMPLIE,COMPILE,LINKEDIT AND BIND


IF YOU CHANGED DB2

YOU SHOULD BIND ONLY THAT PACKAGE
Back to top
View user's profile Send private message
hanu_010

New User


Joined: 25 Jan 2007
Posts: 9
Location: hyd

PostPosted: Mon Mar 05, 2007 6:26 pm
Reply with quote

During Impact analysis i have changed the field from 9(3) to 9(6).
Now the values will be as 000123. I want to change this zero into space.
How will u do it using DB2?


I THINK REDEFINE THAT VARIABLE

X(6)
Back to top
View user's profile Send private message
hanu_010

New User


Joined: 25 Jan 2007
Posts: 9
Location: hyd

PostPosted: Mon Mar 05, 2007 6:28 pm
Reply with quote

AS PERFOMANCE JCL IS BEST
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Wed Mar 07, 2007 12:13 am
Reply with quote

Yes we need only one plan for main and subprograms
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 12:30 am
Reply with quote

Hello,

You will not be able to store spaces in a numeric DB2 field.

DB2 does not support redefinition.
Quote:
I THINK REDEFINE THAT VARIABLE


Also, i am not clear on what information is givenhere:
Quote:
AS PERFOMANCE JCL IS BEST


Some clarification would be helpful.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Wed Mar 07, 2007 12:50 am
Reply with quote

dick i think he mensioned about making some process in cobol then store that to db2. the second one i think he says that jcl is better in performance wise in the sorting process
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 1:06 am
Reply with quote

Hi Cobolunni,

From what he posted:
Quote:
I want to change this zero into space.
How will u do it using DB2?

it sounded to me like he had a numeric field that he now wants to move a space to. I easily could have misunderstood the situation.

As far as the sorting (thanks for making that clear - i definitely missed that one) whether the internal COBOL sort or the stand-alone JCL sort the answer depends on the process. Sometimes one is better sometimes the other.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Wed Mar 07, 2007 1:15 am
Reply with quote

dick can you say some situations when cobol sort becomes better
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Mar 07, 2007 3:38 am
Reply with quote

Sure,

Here's one:

Let's say that there is a file with 100 million records and to produce a particular output (report or file - doesn't really matter) we will only actually use 50,000 of those - the rules for selecting these records require much more logic than can be done with the sort.

It will be much less overhead to have a program read the entire file, selecting the 50,000 records based on the rules, sorting them internally, and producing the output rather than sorting the entire file (100million in, 100million sorting, 100million out) then having the program read the newly sorted 100million records to produce the output of the desired 50,000 records.

One way the system must read 100million, sort 100million, write 100million, then read the sorted 100million back in to process 50,000 needed entries. The other, the system must read 100million, sort 50,000, and "read" 50,000. When the sort is coded it would use input procedure/release and output procedure/return. The final output doesn't enter into it as the same amount of "output" would be created in either case.

Please let me know if you'd like any other info.
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Wed Mar 07, 2007 5:58 pm
Reply with quote

Hello Suganth

During Impact analysis i have changed the field from 9(3) to 9(6).
Now the values will be as 000123. I want to change this zero into space.
How will u do it using DB2?

1. As all said Move in COBOL

2. u can use substr to get the value 123 in the Db2 query

3.Replace works only for char field use the Cast\ function to get numeric field converted into Char & then use replace

Example 2: Replace string 'ABC' in the string 'ABCXYZ' with nothing, which
is the same as removing'ABC' from the string.

SELECT REPLACE('ABCXYZ','ABC','')
FROM SYSIBM.SYSDUMMY1:

The result is the string 'XYZ'.


Thanks n Regards
Prasad
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 127
Location: kerala,india

PostPosted: Wed Mar 07, 2007 9:14 pm
Reply with quote

fine thanks dick
Back to top
View user's profile Send private message
deepak.vl

New User


Joined: 17 Feb 2007
Posts: 38
Location: Hyderabad

PostPosted: Wed Mar 07, 2007 9:44 pm
Reply with quote

Hi Dick, I have a question on the sort example you've given. How about using the below approach in JCL

STEP1: Run a cobol program which reads the file with 100 million records and creates a file with 50000 records
STEP2: Use JCL SORT by inputting the file generated by the above step.

I am not sure if this is a better method or not. Please through some light on this.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Mar 08, 2007 7:05 am
Reply with quote

Hello,

I believe the previous reply was accidentally posted in the wrong thread. This thread is about sorting considerations rather than data manipulation/initialization.

Prasad, please post in the correct thread.

To address the mis-placed reply:

Do not move spaces to a pic 9(n) field. The proper method to "change this zero into space" is to change the definition of the field from numeric to character in the table definition.
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 Comp interview questions Mainframe Interview Questions 5
No new posts Interview Questions on Cobol DB2 program Mainframe Interview Questions 5
No new posts The Last Two Question For You To Ask ... Mainframe Interview Questions 0
No new posts Mainframe Interview Questions CICS,CO... Mainframe Interview Questions 6
No new posts Viewing executing process in NDM .. q... IBM Tools 0
Search our Forums:

Back to Top