1. Define sort? and its syntax?

Here the sort is considered as an internal sort that is we
want to manipulate the data before feeding it to sort.Else
in rest of the cases we use external sort.
The syntax is :
SORT SORTFILE ON ASCENDING/DESCENDING KEY
USING FILE1,FILE2/ INPUT PROCEDURE PARA-1
GIVING FILE3/ OUTPUT PROCEDURE PARA-2

2. What is INPUT PROCEDURE and OUTPUT PROCEDURE?

SORT WORKFILE ASCENDING KEY EMP-NO
INPUT PROCEDURE PARA-1
OUPUT PROCEDURE PARA-2.
SO INPUT PROCEDURE(RELASE THE RECORDS FOR SORTING)
OUTPUT PROCEDURE(RETURN THE SORTED RECORDS).

3. What is redefine and its syntax?

REDEFINE is a Cobol Verb.

It is similar to RENAME Verb.
It uses the same WORKING-STORAGE memory of a data name
With another data name programmer want instead.

Syntax.

WORKING-STORAGE SECTION.
01 WS-NAME PIC x(15).
01 WS-AGE PIC 99.
05 NAME REDIFINES WS-NAME.

4. How can i change the below code in SQL to cobol/400?
EXEC SQL SELECT COUNT(*) INTO : WS-COUNT FROM Db file
WHERE Field 1 = : WS-VAR AND
Field 2 = : WS-USERID
END-EXEC

Declare below three variables in working storage section.

77 WS-COUNT PIC 99. VALUE ZEROS.
77 WS-VAR PIC X(10) VALUE "WELCOME".
77 WS-USERID PIC x(5) VALUE "AAAAA".
Decalre one indicator for end of file.
04 EOF-DB-FILE PIC X VALUE "N".
88 EOF-DB-FILE VALUE "Y".
Read each record from input file(Db file) and increase
count if the conditions are satisfied.
PROCEDURE DIVISION.
OPEN INPUT DB-FILE.
READ Db-file
AT END MOVE "Y" TO EOF-DB-FILE
GO TO 1000-EXIT.
IF FIELD1 = WS-VAR AND FIELD2 = WS-USERID
ADD 1 TO WS-COUNT
END-IF
GO TO 1000-EXIT.
DISPLAY WS-COUNT
CLOSE DB-FILE.
STOP RUN.

5. When search all is used in cobol program without sorted input data?

SEARCH ALL is a binary search. So, the data needs to be in
sorted order and the array used for search all operation
should have index by.

6. How to update data area in cobol 400 program?

Either DISPLAY keywords in COBOL-400 we can update the data
area.
For example
MOVE 'bbbb' TO GP-FILLER.
DISPLAY GP-FILLER UPON OTHER-DATA-AREA
FOR "SKDTAARA" LIBRARY "QGPL".

7. Code how to read 5th element of the array?

In COBOL we can directly access the particular index of the
array using subscript.

Eg: Arrayname(5)
or
Move 5 to indx
Arrayname(indx).

8. How to Convert 2010/02/11 to m/dd/yyy.. with string and without string if any other method... code?

The above issue can be resolved by using REDEFINES clause.

01 DATE-FIELD
05 DATE-YYYY PIC 9(04).
05 DATE-MM PIC 9(02).
05 DATE-DD PIC 9(02).
01 DATE-CONT REDEFINES DATE-FIELD
05 DATE-MM-CONT PIC 9(02).
05 DATE-DD-CONT PIC 9(02).
05 DATE-YYYY-CONT PIC 9(04).

I guess the above declaration will resolve it. I have not
tested it.

9. How to detect record is locked in Cobol/400?
Wat is the solution for that?

Check the file status, if the file status is 9D then it indicates that the record is locked. Solution should be READ the file with NO LOCK.

10. What is the cobol compiler?

The cobol compiler is IGYCRCTL