Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Tesco Interview Questions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: Tesco Interview Questions
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    Post subject:
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    Post subject: Suganth Ans
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    Post subject: Re: Tesco Interview Questions
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    Post subject: Re: Tesco Interview Questions
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    Post subject:
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    Post subject:
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    Post subject:
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: 128
Location: kerala,india

PostPosted: Wed Mar 07, 2007 12:13 am    Post subject:
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

Site Director


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

PostPosted: Wed Mar 07, 2007 12:30 am    Post subject:
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: 128
Location: kerala,india

PostPosted: Wed Mar 07, 2007 12:50 am    Post subject:
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

Site Director


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

PostPosted: Wed Mar 07, 2007 1:06 am    Post subject:
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: 128
Location: kerala,india

PostPosted: Wed Mar 07, 2007 1:15 am    Post subject:
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

Site Director


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

PostPosted: Wed Mar 07, 2007 3:38 am    Post subject:
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    Post subject:
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: 128
Location: kerala,india

PostPosted: Wed Mar 07, 2007 9:14 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Mar 08, 2007 7:05 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts The Last Two Question For You To Ask ... CaptBill Mainframe Interview Questions 0 Fri Apr 14, 2017 5:42 am
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts SAS Programming - Basic Questions Techelm All Other Mainframe Topics 3 Fri Mar 18, 2016 10:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us