View previous topic :: View next topic |
Author |
Message |
sreelatha_mf Beginner
Joined: 07 Aug 2006 Posts: 3 Topics: 3
|
Posted: Sun Aug 27, 2006 11:08 am Post subject: Cobol/DB2/JCL interview Questions |
|
|
1. Can we move comp values to comp-3 values
2. How do u know that diff applications r using the same database.??
How do u know that the particular field is used in which table??
3. What happens when time parameter is given in both job and step? |
|
Back to top |
|
|
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Sun Aug 27, 2006 11:41 am Post subject: |
|
|
sreelatha_mf,
Yes we can move values from COMP to COMP-3 variables.
Try this code for positive numbers:
Code: |
01 COMP-VARIABLE01 PIC S9(4) COMP VALUE 1234.
01 COMP3-VARIABLE01 PIC S9(6)V9(2) USAGE COMP-3.
PROCEDURE DIVISION.
0000-MAIN.
MOVE COMP-VARIABLE01 TO COMP3-VARIABLE01.
DISPLAY 'COMP3-VARIABLE01 IS ' COMP3-VARIABLE01.
|
OUTPUT
Code: |
COMP3-VARIABLE01 IS 00123400
|
Try this code for negative numbers:
Code: |
01 COMP-VARIABLE01 PIC S9(4) COMP VALUE -1234.
01 COMP3-VARIABLE01 PIC S9(6)V9(2) USAGE COMP-3.
PROCEDURE DIVISION.
0000-MAIN.
MOVE COMP-VARIABLE01 TO COMP3-VARIABLE01.
DISPLAY 'COMP3-VARIABLE01 IS ' COMP3-VARIABLE01.
|
OUTPUT
Code: |
COMP3-VARIABLE01 IS 0012340}
|
Check this link for interpreting zoned numbers.Hope this helps.
http://www.mvsforums.com/helpboards/viewtopic.php?t=6889&highlight=sheet
2.
If you have a field by name EMPNO and you know the table in which the field resides then you can run the query below:
Code: |
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = 'SHEKAREMP';
---------+---------+---------+---------+---------+---------+---------+-----
NAME TBNAME TBCREATOR COLNO COLTYPE LENGTH
---------+---------+---------+---------+---------+---------+---------+-----
EMPNO SHEKAREMP SHEKAR 1 CHAR 6
|
OR
If you need to know the field EMPNO is present in which all tables then run the following query which will list out all the Table Names (TBNAME) which will contain the field description.
Code: |
SELECT * FROM SYSIBM.SYSCOLUMNS WHERE NAME = 'EMPNO';
|
3. If the TIME parameter is coded on both the JOB and EXEC statements,then the TIME parameter on the EXEC statement will override the TIME parameter on the JOB statement. _________________ Shekar
Grow Technically |
|
Back to top |
|
|
|
|