View previous topic :: View next topic
|
Author |
Message |
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
Hi Friends,
Foll are the interview questions i have faced.
1. I want to copy the records from flat file into Ksds file. But the Records are in unsorted manner. but i want to copy the records in the Sorted manner from PS to KSDS. How?
2. In an Array consider i am having 10 records how they are stored
while using Subscript and How to display 5 th element for both the
case of Subscript and INDEX.
3. I am having VSAM file, Application Program and JCL to execute that program. In this i have to change the Lrecl from 80 to 88. What all are the changes i have to do in the Application Program,Vsam File and Jcl.that 8 bytes should be in the middle only.
for ex: 1.............80 (before impact)
1.....40 41...48........88.
4. How the Sign bit is stored in Comp?
Can u please tell me how to do this.
Thanks and Regards,
suganthy. |
|
Back to top |
|
|
suganthyprabha
New User
Joined: 28 Jul 2005 Posts: 58
|
|
|
|
Friends,
One more questions to add.
1. We know the use of With hold option. The cursor will be opened after Commit. How can i close the Cursor explicitly.
Cursor life cycle is:
1. OPEN 2. FETCH 3. CLOSE
I this during which operation the Cursor comes into picture that is it will be activated? |
|
Back to top |
|
|
sathish_rathinam
New User
Joined: 22 Aug 2005 Posts: 59 Location: india
|
|
|
|
hi suganthy,
1.use SORT FIELDS=COPY AND SORT FILELDS =(1,5,CH,A)
IN THE SYSIN DD *.
4.SIGN IS STORED IN MOST SIGNIFICANT BIT ,IF THE VALUE IS POSITIVE MSB IS 0 AND IF THE VALUE IS NEGATIVE IT IS 1.
3.CHANGE THE FILE SECTION STATEMENT LIKE RECORD CONTAINS 88 CHARACTERS.
REGARDS,
SATHISH |
|
Back to top |
|
|
ikumar
New User
Joined: 02 Aug 2005 Posts: 81
|
|
|
|
Answers to your cursor questions:
1) you have to close the curosr explicitly like,
EXEC SQL CLOSE cursor-name END-EXEC
2) To tell DB2 that you are ready to process the first row of the result table, execute the OPEN statement in your program. Execute an OPEN CURSOR to make the cursor available to the application.
Answers to ur questions in first post:
1) SORT on the key and use REPRO to copy from PS to KSDS file.
2) You can display 5th element using subscript like,
Move 5 to ws-sub1
DISPLAY WS-ARRAY(ws-sub1).
To calculate index: (occurance ? 1) * length of the element
4)In the most significant bit. Bit is ON if -ve, OFF if +ve. |
|
Back to top |
|
|
sathish_rathinam
New User
Joined: 22 Aug 2005 Posts: 59 Location: india
|
|
|
|
hi,
for index ,set +5 to indexedvariable of indexby clause and display indexvariable(5) to get the 5th element.
i dont know whther there is standard formula as ikumar said.
regards,
sathish |
|
Back to top |
|
|
|