Q.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?
Q.2) HOW TO SET THE RESTART LOGIC IN DB2?
Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.
Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?
Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?
Q.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.
Q.7) FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????
Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?
I think you are trying for a job hardly,I give you a simple suggestion.
If you didnt know any answers for a question plz follow this,
"DONT LOOK FOR EXACT ANSWERS.LOOK FOR WHERE I CAN GET THE ANSWERS"
All the best,
Cheers,
kumaresh.M
.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?
Q.2) HOW TO SET THE RESTART LOGIC IN DB2?
Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.
Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?
Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?
for above questions please read COBOL & DB2 Developers guide.its avilable in the Download area of the website.
.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.
Catalog is nothing but indexing.IF u know the whole dataset name type fully in the 3.4,and u can get it.
FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????
Refer JCL Reference Guide.
Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?
First using the subquery FETCH FIRST 100 ROWS ONLY in the result table.and use the MAX function to find out the Maximum salary.
For call sample programs please go through the link.
www.csis.ul.ie/COBOL/examples/default.htm
(Moderators can i post links like this,If no please remove my link and Majid send me a PM i reply to you)
1. values stored in packed decimal are not in readable format.
A) In a cobol program , if we want to print them into report, we simply move them to numeric edited-variables.
eg:
WS-TOT-ORDERS PIC 9(9) COMP-3 VALUE ZERO.
In File section record-description of report file, we describe a numeric edited variable.
05 P-COUNT PIC ZZZ,ZZZ,ZZ9.
In procedure division, we can move the comp-3 field to numeric edited field before writing report-rec.
MOVE WS-TOT-ORDERS TO P-COUNT.
B) If you are trying to display packed decimal field of a file thru jcl, you can use DFSORT'S 'outrec edit=...' feature.
eg:
//XXXX PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//INFILE DD DSN=....
//SYSIN DD *
OPTION COPY
OUTREC BUILD=(1,60,70,8,PD,EDIT=(SIII,III,IIT),SIGNS=(+,-)
/*
Here , the packed decimal field starting at column 70 and occupying 8 bytes length is numeric edited to a readable format in the output record. 'I' shows the leading insignificant digit to be displayed as blanks if it contains zero. 'T' will display the digit as it is.
YOU can also use TO=desired_format
Following will convert the above packed decimal field to readable zonedecimal field in the output record.
OUTREC OVERLAY=(70:70,8,PD,TO=ZD)
Stored procedure is program that runs on database server ( is controlled by database serve) and it can be accessed by exec sql call statement in the client pgm. Eg if stored procedure name is ABC, my client pgm can access it by:
EXEC SQL
CALL ABC(arguments)
END-EXEC
Advantages:
1. Reduces network traffic
It puts a group of sql staments on the database server. If all these statements are within the client program, it statement would require 2 trips across network ( to and from database). Putting a group of all these sql statements in stored-procedure on the database server and then calling stored procedure with arguments, would cause 2 trips for all these statements alltogether.
So, grouping SQL statements together can save on network traffic. Grouping SQL statements results in two trips across the network for each group of statements, resulting in better performance for applications.
2. Enforcement of business rules
You can use stored procedures to define business rules that are common to several applications. This is another way to define business rules, in addition to using constraints and triggers.
When an application calls the stored procedure, it will process data in a consistent way according to the rules defined in the stored procedure. If you need to change the rules, you only need to make the change once in the stored procedure, not in every application that calls the stored procedure.
Q.1) HOW CAN WE SEE COMP3 VALUES,BCZ THAT STORED IN PACKED
DECIMAL FORM ?
Ans: Move the same to edited value field, i.e. zzzz format.
Q.2) HOW TO SET THE RESTART LOGIC IN DB2?
In most of the shop there is some restart table, so when u start the program just manke a entry on that table with ur prog name, job name, table name and counters. Now when ever you do commit, just update this table with information and in counter give the number of row that u have committed. E.g say ur table has got 200 rows and u r commiting after performing calculation for 35, so in counter give 35 and rest other info like prog name, table name and all. Once u complete the whole execution do remeber to delete this row.
One thing that u need to remeber when ever u r executing this program just read that table, if there is any entry for that particular program it means it's not the first run(i.e restart), otherwise it's fresh execution. If the entry is avilable then skip those many record which is present in counter column and do the processing of the rest.
Q.3) WHAT IS INDEX IN DB2 ? HOW ACTUALY IT WORKS INTERNALLY.
Index in DB2 is nothing but used for optimaztions of query. Say u have 5 columns and per bussiness need u know that 1,3, n 5th will be used frequently, so u create a index this helps while fetching the data from table in less DB2 cost.
Q.4) WHAT IS STORED PROCEDURE IN DB2, WHAT R THE ADVANTAGES USING THE SP INSTEAD OF COBOL-DB2 PROGRAM?
Answered already.
Q.5) WHAT IS CALL BY REFERENCE AND CALL BY CONTENT, KINDLY CAN
U TELL THE CODE FOR ABOVE TWO?
Say one program is calling another program then in that case u cann pass varaible from one program to another eithr by content or by refernce. In case of by content, if the value of the passed varibale is being changed in called program it won't be reflected in calling program where as in case of call by refernce it will.
Call B using X1, X2,X3 and Call B using X1,X2,x3 by value. First one is by refernce and other one is by COntent or value. In cobol by default it is call by refernce....(*i m lil confused plz any one cofirm)
Q.6) IF I AM DOING UNCATLOG SOME DATA SET ? THEN IT WILL REMOVE THE ENTRY FROM SYSTEM CATLOG , AFTER THIS CAN I ACCES THIS DATA SET IN 3.4 OR IF I WANT TO USE IN SOME JCL THEN HOW CAN WE REFER TO UNCATLOG DATA SETS.
In 3.4 u can't see uncateloged dataset.For the same almost every shop provides an utility to get it back. That utility is shop specific. U need to check with ur admin.
Q.7) FOR CONCATENATION PDS OR PS WHAT UTILITY WE USE
PGM = ??????
Just give PS name in sequence..e.g
X1 DD DSN=ps1, disp=<wat ever required>
DSN=ps2, disp=<wat ever required>
DSN=ps3, disp=<wat ever required>
DSN=ps4, disp=<wat ever required>
Q.8) QUERY FOR FIND THE MAXIMUM SALARY COLUMN FORM THE TABLE WHICH HAS 1000 ROWS , BUT I NEED ONLY 100 ROWS WHICH HAS MAX SALARY ?
Already answred.
Yes, during calling the sub program you are giving syntax as Call by refference is default wat about call by value it should be call B x1,x2,x2 by content.