I tried many ways in displaying the statements in IF-else but none worked me.
Pls help me in solving the problem.
I'l post the code below.
000001 IDENTIFICATION DIVISION.
000002 * ******THIS IS THE PGM FOR DISPLAYING REC IN TAB.***
000003 * ****************BOTH DELIVERY INST & GRN*************
000004 PROGRAM-ID. COBOSS01.
000005 AUTHOR. GOWTHAM.
000006 DATE-WRITTEN. 31.10.12.
000007 DATE-COMPILED. 15.10.12.
000008 ENVIRONMENT DIVISION.
000009 CONFIGURATION SECTION.
000010 SOURCE-COMPUTER. LENOVO.
000011 OBJECT-COMPUTER. LENOVO.
000012 DATA DIVISION.
000013 WORKING-STORAGE SECTION.
000014 01 MAINHEAD1.
000015 02 FILLER PIC X(30) VALUE SPACES.
000016 02 FILLER PIC X(20) VALUE "ABC COMPANY LTD".
000017 02 FILLER PIC X(30) VALUE SPACES.
000018 01 MAINHEAD2.
000019 02 FILLER PIC X(25) VALUE SPACES.
000020 02 FILLER PIC X(30) VALUE "PURCHASE ORDER ENTRY SYSTEM".
000021 02 FILLER PIC X(25) VALUE SPACES.
000022 01 MAINHEAD3.
000023 02 FILLER PIC X(20) VALUE SPACES.
000024 02 FILLER PIC X(20) VALUE "DELIVERY INSTRUC".
000025 02 FILLER PIC X(2) VALUE "&".
000026 02 FILLER PIC X(20) VALUE "GOODS RECEIPT NOTE".
000027 02 FILLER PIC X(13) VALUE SPACES.
000028 01 MAINHEAD4.
000029 02 FILLER PIC X(60) VALUE SPACES.
000030 02 C-DATE PIC 99/99/99.
000031 02 FILLER PIC X(10) VALUE SPACES.
000032 01 MAINHEAD5.
000033 02 FILLER PIC X(60) VALUE SPACES.
000034 02 C-TIME PIC 9(10).
000035 02 FILLER PIC X(10) VALUE SPACES.
000036 01 SUBHEAD.
000037 02 FILLER PIC X(80) VALUE ALL '-'.
000038 01 SUBHEAD1.
000039 02 FILLER PIC X(3) VALUE "INO".
000040 02 FILLER PIC X(2) VALUE SPACES.
000041 02 FILLER PIC X(3) VALUE "INM".
000042 02 FILLER PIC X(7) VALUE SPACES.
000043 02 FILLER PIC X(3) VALUE "TQR".
000044 02 FILLER PIC X(2) VALUE SPACES.
000045 02 FILLER PIC X(3) VALUE "RED".
000046 02 FILLER PIC X(1) VALUE SPACES.
000047 02 FILLER PIC X(5) VALUE "RMUSN".
000048 02 FILLER PIC X(2) VALUE SPACES.
000049 02 FILLER PIC X(5) VALUE "TRMAV".
000050 02 FILLER PIC X(2) VALUE SPACES.
000051 02 FILLER PIC X(5) VALUE "RMUD1".
000052 02 FILLER PIC X(2) VALUE SPACES.
000053 02 FILLER PIC X(5) VALUE "RMWD1".
000054 02 FILLER PIC X(2) VALUE SPACES.
000055 02 FILLER PIC X(5) VALUE "TTRM1".
000056 02 FILLER PIC X(2) VALUE SPACES.
000057 02 FILLER PIC X(5) VALUE "NTRMA".
000058 02 FILLER PIC X(2) VALUE SPACES.
000059 02 FILLER PIC X(5) VALUE "ITDPD".
000060 02 FILLER PIC X(2) VALUE SPACES.
000061 02 FILLER PIC X(5) VALUE "CSPKG".
000062 02 FILLER PIC X(2) VALUE SPACES.
000063 01 ABCCOMPLTD.
000064 02 CRECORDS OCCURS 10 TIMES.
000065 05 IT-ITEMNO PIC 9(2).
000066 05 FILLER PIC X(2) VALUE SPACES.
000067 05 IT-ITEMNAME PIC 9(5).
000068 05 FILLER PIC X(2) VALUE SPACES.
000069 05 TQREQ PIC 9(3).
000070 05 FILLER PIC X(2) VALUE SPACES.
000071 05 DAYSREMAIN PIC 9(2).
000072 05 FILLER PIC X(2) VALUE SPACES.
000073 05 RM-USED PIC 9(2).
000074 05 FILLER PIC X(2) VALUE SPACES.
000075 05 TOTRM-AVL PIC 9(3).
000076 05 FILLER PIC X(2) VALUE SPACES.
000077 05 RM-USDP1 PIC 9(3).
000078 05 FILLER PIC X(2) VALUE SPACES.
000079 05 RM-WSD1 PIC 9(3).
000080 05 FILLER PIC X(2) VALUE SPACES.
000081 05 TOT-RM PIC 9(5).
000082 05 FILLER PIC X(2) VALUE SPACES.
000083 05 NETRM-ALL PIC 9(5).
000084 05 FILLER PIC X(2) VALUE SPACES.
000085 05 IT-DPD PIC 9(3).
000086 05 FILLER PIC X(2) VALUE SPACES.
000087 05 STK-MST PIC 9(5)V9(5).
000088 05 FILLER PIC X(2) VALUE SPACES.
000089 05 COST-PKG PIC 9(3).
000090 05 FILLER PIC X(2) VALUE SPACES.
000091 05 NETCST PIC 9(5).
000092 77 RIND PIC 9(2) VALUE 1.
000093 PROCEDURE DIVISION.
000094 FILLER-PARA.
000095 DISPLAY MAINHEAD1.
000096 DISPLAY MAINHEAD2.
000097 DISPLAY MAINHEAD3.
000098 ACCEPT C-DATE FROM DATE YYYYMMDD.
000099 ACCEPT C-TIME FROM TIME.
000100 DISPLAY "DATE:" MAINHEAD4.
000101 DISPLAY "TIME:" MAINHEAD5.
000102 DISPLAY SUBHEAD.
000103 DISPLAY SUBHEAD1.
000104 DISPLAY SUBHEAD.
000105 MAIN-PARA.
000106 PERFORM VARYING RIND FROM 1 BY 1 UNTIL RIND > 10
000107 ACCEPT IT-ITEMNO(RIND)
000108 ACCEPT IT-ITEMNAME(RIND)
000109 ACCEPT TQREQ(RIND)
000110 ACCEPT DAYSREMAIN(RIND)
000111 ACCEPT RM-USED(RIND)
000112 ACCEPT TOTRM-AVL(RIND)
000113 ACCEPT RM-USDP1(RIND)
000114 ACCEPT RM-WSD1(RIND)
000115 PERFORM TOTRM-PARA
000116 PERFORM NETRM-PARA
000117 PERFORM RMDECISION-PARA
000118 ACCEPT IT-DPD(RIND)
000119 PERFORM STKMSR-PARA
000120 PERFORM STKMSRDECISION-PARA
000121 ACCEPT COST-PKG(RIND)
000122 PERFORM NETCST-PARA
000123 DISPLAY CRECORDS(RIND)
000124 END-PERFORM.
000125 DISPLAY SUBHEAD.
000126 STOP RUN.
000127 TOTRM-PARA.
000128 COMPUTE TOT-RM(RIND) = RM-USDP1(RIND) + RM-WSD1(RIND).
000129 NETRM-PARA.
000130 COMPUTE NETRM-ALL(RIND) = TQREQ(RIND) * TOT-RM(RIND).
000131 RMDECISION-PARA.
000132 IF (NETRM-ALL(RIND) > TOTRM-AVL(RIND))
000133 DISPLAY "STOCK IN DEMAND STOP PROCESS TEMP"
000134 ELSE
000135 IF (NETRM-ALL(RIND) = TOTRM-AVL(RIND))
000136 DISPLAY "STOCK IS ONLY SUFFICIENT"
000137 ELSE
000138 DISPLAY "STOCK IS EXCESS"
000139 END-IF
000140 END-IF.
000141 STKMSR-PARA.
000142 COMPUTE STK-MST(RIND) = TQREQ(RIND) / IT-DPD(RIND).
000143 DISPLAY STK-MST(RIND).
000144 STKMSRDECISION-PARA.
000145 IF (STK-MST(RIND) <= DAYSREMAIN(RIND))
000146 DISPLAY "OPEN ORDERS FOR DAY2"
000147 ELSE
000148 DISPLAY "CLOSE ORDERS FOR DAY2"
000149 END-IF.
000150 NETCST-PARA.
000151 COMPUTE NETCST(RIND) = COST-PKG(RIND) * NETRM-ALL(RIND).
000152 DISPLAY NETCST(RIND).
If else statements from line 131 to 140 is not executing correctly for me. Whatever the condition its displaying stock in demand statement.
The second IF-else from line 144 to 149 is not executing. Similarly whatever the condition here it always displaying open orders for day2.
Pls help me in solving these problem.
Kind regards
gyaa