View previous topic :: View next topic
|
Author |
Message |
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
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 |
|
|
sanya9
New User
Joined: 05 Sep 2005 Posts: 13
|
|
|
|
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 |
|
|
sanya9
New User
Joined: 05 Sep 2005 Posts: 13
|
|
|
|
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 |
|
|
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
Hi Kiran,
Thanks for ur Reply. Can u guys answer me for the First Question?
Thanks and Regards,
Suganthyprabha. |
|
Back to top |
|
|
hanu_010
New User
Joined: 25 Jan 2007 Posts: 9 Location: hyd
|
|
|
|
. 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 |
|
|
hanu_010
New User
Joined: 25 Jan 2007 Posts: 9 Location: hyd
|
|
|
|
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 |
|
|
hanu_010
New User
Joined: 25 Jan 2007 Posts: 9 Location: hyd
|
|
|
|
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 |
|
|
hanu_010
New User
Joined: 25 Jan 2007 Posts: 9 Location: hyd
|
|
|
|
AS PERFOMANCE JCL IS BEST |
|
Back to top |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
Yes we need only one plan for main and subprograms |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
dick can you say some situations when cobol sort becomes better |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88
|
|
|
|
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 |
|
|
cobolunni
Active User
Joined: 07 Aug 2006 Posts: 127 Location: kerala,india
|
|
|
|
fine thanks dick |
|
Back to top |
|
|
deepak.vl
New User
Joined: 17 Feb 2007 Posts: 38 Location: Hyderabad
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|