Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


IDENTIFICATION DIVISION.
PROGRAM-ID. UPDT.
AUTHOR.anbu.
DATE-WRITTEN. AUG 13.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.

FILE-CONTROL.

SELECT CMSTR ASSIGN TO CINP1
ORGANIZATION IS INDEXED
ACCESS IS SEQUENTIAL
RECORD KEY CM2-KEY
FILE STATUS IS WS-CMSTR-FST.

SELECT CTAB ASSIGN TO CINP2
ORGANIZATION IS
ACCESS IS
SEQUENTIAL
RECORD KEY VSAM-WHSE-
KEY
FILE STATUS IS WS-CTAB-
FST.


DATA
DIVISION.

FILE
SECTION.



FD
CMSTR.

COPY
RXCYFC20.


FD
CTAB.

COPY
AITYWHSE.


************************************************************
******
*** WORKING STORAGE
VARIABLES ***
************************************************************
******


WORKING-STORAGE
SECTION.
01 WS-
VARIABLES.
05 WS-EB PIC X(02) VALUE
ZEROES.
05 WS-DIV PIC 9(03) VALUE
ZEROES.
05 WS-CMF-RECS-REWRITTEN PIC 9(01) VALUE
ZERO.
*** FILE STATUS
VARIABLES ***


05 WS-
FILESTATUS.
10 WS-CMSTR-FST PIC 9(02) VALUE
ZEROES.
10 WS-CTAB-FST PIC 9(02) VALUE
ZEROES.


*** END OF FILE
VARIABLES ***


05 WS-CMSTR-EOF PIC X(01)
VALUE 'N'.
88 WS-CMSTR-EOF-YES
VALUE 'Y'.
88 WS-CMSTR-EOF-NO
VALUE 'N'.
05 WS-CTAB-EOF PIC X(01)
VALUE 'N'.
88 WS-CTAB-EOF-YES
VALUE 'Y'.
88 WS-CTAB-EOF-NO
VALUE 'N'.


**** ERROR
VARIABLES ****


05 WC-ABEND-900 PIC 9(03) VALUE
900.
05 WE-ERR-CODE PIC 9(02) VALUE
ZEROES.
05 WE-ABEND-CODE PIC 9(03) VALUE
ZEROES.


************************************************************
****
********* PROCEDURE DIVISON
**********
************************************************************
****


PROCEDURE
DIVISION.


0000-
BEGIN.
PERFORM 1000-INITIALISE THRU 1000-
EXIT.
PERFORM 2000-PROCESS THRU 2000-
EXIT
UNTIL WS-CMSTR-EOF-
YES.


DISPLAY 'WS-CMF-RECS-REWRITTEN :' WS-CMF-RECS-
REWRITTEN.
PERFORM 5000-CLOSE THRU 5000-
EXIT.

GOBACK.
0000-
EXIT.

EXIT.


1000-
INITIALISE.


OPEN I-O
CMSTR.


EVALUATE WS-CMSTR-
FST
WHEN
00
WHEN 97
CONTINUE
WHEN OTHER
DISPLAY 'ERROR IN READING INPUT FILE: '
DISPLAY WS-CMSTR-FST
MOVE WS-CMSTR-FST TO WE-ERR-CODE
PERFORM 9999-ABEND-PARA THRU 9999-EXIT
END-EVALUATE.

OPEN INPUT CTAB.

EVALUATE WS-CTAB-FST
WHEN 00
WHEN 97
CONTINUE
WHEN OTHER
DISPLAY 'ERROR IN READING INPUT FILE: '
DISPLAY WS-CTAB-FST
MOVE WS-CTAB-FST TO WE-ERR-CODE
PERFORM 9999-ABEND-PARA THRU 9999-EXIT
END-EVALUATE.
1000-EXIT.
EXIT.
2000-PROCESS.

READ CMSTR.

EVALUATE WS-CMSTR-FST
WHEN 00
CONTINUE
WHEN 10
SET WS-CMSTR-EOF-YES TO TRUE
GO TO 2000-EXIT
WHEN OTHER
DISPLAY 'ERROR IN READING INPUT FILE: '
DISPLAY WS-CMSTR-FST
MOVE WS-CMSTR-FST TO WE-ERR-CODE
PERFORM 9999-ABEND-PARA THRU 9999-EXIT
END-EVALUATE

IF CM2-RECORD-TYPE-SOLD-TO
MOVE CM2-ENTERING-BRANCH TO WS-EB
PERFORM 3000-READ THRU 3000-EXIT
UNTIL WS-CTAB-EOF-YES
END-IF.

2000-EXIT.
EXIT.

3000-READ.

MOVE WS-EB TO VSAM-WHSE-CD.
MOVE 'WHSE' TO VSAM-WHSE-ID.

READ CTAB.
EVALUATE WS-CTAB-FST
WHEN 00
MOVE WHSE-DIV-CODE TO WS-DIV
PERFORM 4000-REWRITE-CMF THRU 4000-EXIT
WHEN 10
SET WS-CTAB-EOF-YES TO TRUE
GO TO 3000-EXIT
WHEN OTHER
DISPLAY 'ERROR IN READING TABLE FILE: '
DISPLAY WS-CTAB-FST
MOVE WS-CTAB-FST TO WE-ERR-CODE
PERFORM 9999-ABEND-PARA THRU 9999-EXIT
END-
EVALUATE.


3000-
EXIT.

EXIT.


4000-REWRITE-
CMF.


IF WS-DIV = 250 OR
252


MOVE 'F' TO CM2-FREIGHT-
TYPE
MOVE 1 TO CM2-FREIGHT-THRESHOLD-
AMT
ADD +1 TO WS-CMF-RECS-
REWRITTEN
REWRITE CM2-SOLD-TO-
RECORD
DISPLAY 'RECORD
UPDATED'
END-
IF.




* EVALUATE WS-CMSTR-
FST
* WHEN
00
*
CONTINUE
* WHEN
OTHER
* DISPLAY 'FILE NOT
UPDATED'
* DISPLAY WS-CMSTR-
FST
* MOVE WS-CMSTR-FST TO WE-ERR-CODE
* PERFORM 9999-ABEND-PARA THRU 9999-EXIT
* GO TO 4000-EXIT
* END-EVALUATE.

4000-EXIT.
EXIT.

5000-CLOSE.

CLOSE CMSTR
CTAB.

5000-EXIT.
EXIT.

9999-ABEND-PARA.

COMPUTE WE-ABEND-CODE = WC-ABEND-900 + WE-ERR-CODE
CALL 'ILBOABN0' USING WE-ABEND-CODE
GO TO 5000-CLOSE.

9999-EXIT.
EXIT.

5000-CLOSE.

CLOSE CMSTR
CTAB.

5000-EXIT.
EXIT.

9999-ABEND-PARA.

COMPUTE WE-ABEND-CODE = WC-ABEND-900 + WE-ERR-CODE
CALL 'ILBOABN0' USING WE-ABEND-CODE
GO TO 5000-CLOSE.

9999-EXIT.
EXIT.






//this program is giving maxcc=0, but not updating..


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More COBOL Interview Questions

I hv ten records in ps file and i hv say some 15 records in vsam file .i hv empno and age in ps file n empno,empname,dept n desig in vsam file. i hv 2 read the ps file n check wid matching empno in vsam file and then insert all fields from ps and vsam into db2 table....plz help in writin the procedure division

1 Answers  


input:-AABBCCDDEFGHIIJ output:- ABCDEFGHIJ Here in input we hav the duplicate characters i.e repeating characters.SO we should eliminate the duplicate characters and should display the output in ascending order.

6 Answers  


I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


Difference between cobol and cobol-ii?

0 Answers  


Which of the following files can be OPENed in all the 4 modes? The four modes are INPUT, I-O, OUTPUT and EXTEND. (a) INDEXED (b) RELATIVE (c) SEQUENTIAL (d) All of the above

7 Answers   TCS,


whats the disadvantage of search all over search?

4 Answers   Patni, TCS,


COMPUTE X = A * B - C * D and COMPUTE X = (A * B) - (C * D) (a) Are not the same (b) Are same (c) Syntactically wrong (d) Will yield a run time error

1 Answers   TCS,


Difference between next and continue clause

4 Answers   Kanbay,


i have a variable block which is used in my cobol program as input file having records of 4080 after compilation while runing the program im getiing file attribut mismatch and it is saying tht the record length of the file is 4084 can any one knw the answer how to reslove it ?

2 Answers  


which is faster either static call or dynamic call ? and specify the reasons for it ? reply fast

1 Answers  


What is the significance of 'above the line' and 'below the line'?

2 Answers   Nokia,


i have the following varibles in the working storage 05 ws-A PIC X(30) VALUE 'ABCDEFGHIJKLMNOPQRESTUVWXYZ ' 05 WS-B REDEFINES WS-A 10 WS-B1 PIC X(10). 10 WS-B2 PIC 9(10). 10 WS-B3 PIC X(10). If I Display B1, B2 and B3 respectively, what is the value displayed in B2

9 Answers  


Categories