CONTROL-CHECK.
IF WS-ALL-ORGS IS EQUAL TO 'Y'
GO TO PROCESS-ACCT.
IF WS-CC-ORG-TYPE IS EQUAL TO WS-CONTROL-ORG
GO TO PROCESS-ACCT.
IF WS-CC-ORG-TYPE IS GREATER THAN WS-CONTROL-ORG
GO TO ACCT-LOOP.
PERFORM READ-CONTROL-CARD THRU READ-CONTROL-CARD-EXIT.
GO TO CONTROL-CHECK.
PROCESS-ACCT.
MOVE ACCT-NMBR (xxx) TO WS-NOMINAL-KEY.
PERFORM CARDHLD-RANDOM-READ THRU CRR-XIT.
IF WS-IO-COMPLETE
GO TO ACCT-CUST.
IF WS-INVALID-ACCT-NBR
MOVE 'X' TO REASON
GO TO BUILD-EXCEPTION.
READ-CONTROL-CARD.
IF WS-CSC-EOF-SW IS EQUAL TO 'Y'
MOVE 'xxxxxx' TO WS-CC-ORG-TYPE
GO TO READ-CONTROL-CARD-EXIT.
READ CONTROL-SPECS
AT END
MOVE 'xxxxxx' TO WS-CC-ORG-TYPE
MOVE 'Y' TO WS-CSC-EOF-SW
GO TO READ-CONTROL-CARD-EXIT.
IF CSC-PROGRAM-NAME NOT = 'xxxxxx' AND 'xxxxxx'
GO TO READ-CONTROL-CARD.
MOVE CSC-CONTROL-CARD TO WS-CONTROL-CARD.
IF WS-CC-ORG-TYPE IS EQUAL TO 'xxxxxxx '
MOVE 'Y' TO WS-ALL-ORGS
MOVE 'xxxxxx' TO WS-CC-ORG-TYPE.
IF WS-CC-ORG-TYPE IS NOT NUMERIC
IF WS-CONSOLE-ACCEPT-SW IS EQUAL TO 'Y'
bla bla bla....
READ-CONTROL-CARD-EXIT. EXIT.
Can you read it ?
Yes, absolutely.
Can you understand it ?
Humm.. yes I do.
Can you manage it ?
Humm... I think I can...
Can you fix it ?
I don't know...
Potongan kode di atas sangat tidak procedural.. sangat spaghetti code... Padahal digunakan di real world system, real world business.. di 8 dari 11 Bank di Indonesia...
Kebayang kan susahnya me manage system buatan orang "lama" yang gak mau menggunakan procedural programming, dan tetep keukeuh menggunakan spaghetti programming ?
This comment has been removed by a blog administrator.
ReplyDeletelam kenal mas
ReplyDeletelam kenal
ReplyDelete@fikar:
ReplyDeletesalam kenal juga :)
wah.. expert nih di COBOL.. bisa ajarin dong
ReplyDeleteplease deh..
@Gochi :
ReplyDeleteHalah...
ndak expert kok Chi...
Cuma bingung aja ama code yang goto goto an gitu..
tapi sekarang dah mulai biasa... dan sepertinya ikutan make goto juga :D
Cobol sendiri gak susah kok.. lebih mudah dari C, C++, java dkk.
Cuma ya gitu deeeeh....
mantaf juga....
ReplyDeleteajari lah ya...pengen cobol2an juga
@mafdhal :
ReplyDeleteWah... ampoon Om...
aku aja belajar ama mbak Pu*ri..
mendingan belajar ama mbak Pu*ri aja Om... dia jago banget Cobol nya..
aku mah, ga ada apa2nya kalo dibanding dia.