Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Logic of START verb with Read next

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Tue Feb 04, 2014 12:21 pm    Post subject: Logic of START verb with Read next
Reply with quote

hi,
I have 2 input files-

File1 having details like
Code:

RD-TYP-BUS RD-RPT-TYPE RD-ITEM-NO
2/NUM      2/NUM       5/NUM
(5-6)      (7-8)       (9-13)
4--------- 5---------- 6---------
****************** TOP OF DATA **
  1           8      18413
  1           8      38365
  1           8      65303
  1           8      77143
  1           8      77212
  1           8      90675
  3           8      19058

File2 having details like:
Code:

MCF-TYP-BUS MCF-ITEM-NO. MCF-DEAL-TAG MCF-DISCO-RPT-FLAG
2/NUM             5/NUM
(1-2)             (3-7)              (8-8) 
3---------------- 4--------------
*********************************
      0               0    0                  1
      1           18413    0                  0
      1           18413    0                  2
      1           18413    0                  0
      1           38366    0                  2
      3           19055    0                  1
      3           19058    0                  1
      3           19058    0                  3


Here file 1 is the flat file and file 2 is a vsam file. i have to match the type business and item no. from both the files and if they matches then i have to update the vsam file (FIle 2) with MCF-DISCO-RPT-FLAG as 4.
In File2 the key is (MCF-TYP-BUS + MCF-ITEM-NO. + MCF-DEAL-TAG ) where type business and item are numeric and deal tag can be alphanumeric.
but File1 does not containg deal-tag which is part of the key in File2.

I am trying to follow the logic of START verb and then reading next record like below-

Read File1
then follow the start verb to populate the partial key (type business + item no.) then based on the file status. keep on reading the fiel 2
i will have to later rewrite the file2.

Can someone please help me on how START verb and read next work and how i have to code my program.

If possible can you please provide a sample code.
Back to top
View user's profile Send private message

sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Tue Feb 04, 2014 1:08 pm    Post subject:
Reply with quote

Hi Sandeeep,

You can find example here for START and here for REWRITE.

You may use below logic for your program:
Code:
open input ps-file.
Open I-O Vsam-file.

Read loop for ps-file
      move ps-type & item-no to vsam-type & item-no
      start Vsam
      if success-start
          read vsam-file for update - Loop
              if ps-type & item-no = vsam-type & item-no
                   update vsam-file
              else
                   stop this inner loop
             end-if
          end-loop
      else
           stop this outer loop
      end-if
end-loop.


Please post your tired code for further clarification.
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Tue Feb 04, 2014 1:39 pm    Post subject: Reply to: Need to know the proper logic of START verb with R
Reply with quote

Thanks Suresh,
Thanks for the infomation.Actually i have to follow the START logic only. I will try with START and Read next logic and post here.
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Tue Feb 04, 2014 4:58 pm    Post subject:
Reply with quote

Hi,
i prepared the program but it is not giving the desired result. Can someone please help-. Below is the program-

Code:

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    RP30H44B.
       AUTHOR.        SANDY.
       DATE-WRITTEN.  FEB 04, 2014.
      ******************************************************************
      *********  MATCHING THE PARTIAL KEY FROM BOTH THE FILES AND ******
      *********  CHANGE THE DISCO-RPT-FLAG OF VSAM FILE TO 4      ******
      ******************************************************************
      **                                                              **
      **  PROGRAM : RP30H44B                                          **
      **                                                              **
      **  DESC    : REWRITES THE MCF VSAM FILE FOR EVERY MATCH OF THE **
      **            PARTIAL KEY ( TYPE BUSINESS AND ITEM NO.). THE    **
      **            DISCO-RPT-FLAG WILL BE REPLACED BY THE VALUE 4    **
      **                                                              **
      **  FILES   : INPUT :  REP-COST-SHP                             **
      **                                                              **
      **            I-O   :  MSTR-COST-VSM                            **
      **                                                              **
      **  DB2     : NONE                                              **
      **                                                              **
      **  IDMS    : NONE                                              **
      ******************************************************************
      ************          IMPLEMENTATION                 *************
      ******************************************************************
  ******************************************************************
       ENVIRONMENT DIVISION.

       CONFIGURATION  SECTION.

       SOURCE-COMPUTER.  IBM-370 WITH DEBUGGING MODE.
      *SOURCE-COMPUTER.  IBM-370.
       OBJECT-COMPUTER.  IBM-370.

       INPUT-OUTPUT  SECTION.
      *
       FILE-CONTROL.
      *
           SELECT MSTR-COST-VSM
                  ASSIGN TO             IMSCSVSM
                  ORGANIZATION IS       INDEXED
                  ACCESS MODE IS        DYNAMIC
                  RECORD KEY IS         MCF-RECORD-KEY
                  STATUS                WS-IMSCSVSM-FS.
           SELECT REP-COST-SHP
                  ASSIGN TO             IORPCSHP
                  STATUS                WS-IORPCSHP-FS.

       DATA DIVISION.

       FILE SECTION.

       FD  MSTR-COST-VSM.
       01  MCF-FILE-RECORD.
       COPY RPMCPVSM.

       FD  REP-COST-SHP
           RECORDING MODE F
           BLOCK CONTAINS 0 RECORDS.
       01  WS-REP-CSTSHP-REC.
       COPY RPCCRDTA.

      ******************************************************************
      **      BEGINNING OF WORKING-STORAGE SECTION                    **
      ******************************************************************
       WORKING-STORAGE SECTION.

       01 FILE-STATUS-IND.
          05 WS-IMSCSVSM-FS                       PIC X(02).
             88  C-IMSCSVSM-OK                     VALUE '00'.
             88  C-IMSCSVSM-DUP-ALTKEY             VALUE '02'.
             88  C-IMSCSVSM-ENDFILE                VALUE '10'.
             88  C-IMSCSVSM-DUPREC                 VALUE '22'.
             88  C-IMSCSVSM-NOTFND                 VALUE '23'.
             88  C-IMSCSVSM-OPEN-NORMAL            VALUE '97'.
             88  C-IMSCSVSM-NOTEXST                VALUE '35'.
          05 WS-IORPCSHP-FS                       PIC X(02).
             88  C-IORPCSHP-OK                     VALUE '00'.
             88  C-IORPCSHP-ENDFILE                VALUE '10'.

       01 WS-FILE-OPEN.
          05 WS-IMSCSVSM-OPN                PIC X(01) VALUE 'N'.
         05 WS-IORPCSHP-OPN                PIC X(01) VALUE 'N'.

      01 WS-INIT-VARS.
         10 WS-COUNTERS.
            15 WS-RPCSHP-REC-READ          PIC 9(08).
            15 WS-MSCSVSM-REC-READ         PIC 9(08).
            15 WS-MATCH-RECS               PIC 9(08).
            15 WS-MISMATCH-RECS            PIC 9(08).
         10 WS-PARANAME                    PIC X(30).
         10 SIV-WHEN-COMPILED.
            15 SIV-WHEN-COMPILED-DATE      PIC X(08).
            15 SIV-WHEN-COMPILED-TIME      PIC X(08).
     *   10 WS-COMPARE-KEY.
     *      15  WS-COMP-TYPE-BUSINESS      PIC 9(02).
     *      15  WS-COMP-ITEM-NUMBER        PIC 9(05).
         10 MCF-PARTIAL-KEY.
            15 WS-MCF-TYPE-BUSINESS        PIC 9(02).
            15 WS-MCF-ITEM-NUMBER          PIC 9(05).
     *   10 REP-PARTIAL-KEY.
     *      15 WS-REP-TYPE-BUSINESS        PIC 9(02).
     *      15 WS-REP-ITEM-NUMBER          PIC 9(05).
     *
     ******************************************************************
     **            BEGINNING OF PROCEDURE DIVISION                   **
     ******************************************************************
      PROCEDURE DIVISION.
     *
      0000-MAIN-PARA.
     *--------------*
          MOVE    '0000-MAIN-PARA'      TO WS-PARANAME
     D    DISPLAY WS-PARANAME

          PERFORM 1000-OPEN-INIT-PARA
             THRU 1000-OPEN-INIT-EXIT

          PERFORM 2000-PROCESS-PARA
             THRU 2000-PROCESS-EXIT
            UNTIL C-IORPCSHP-ENDFILE

           PERFORM 9000-CLOSE-FILE-PARA
              THRU 9000-CLOSE-FILE-EXIT

           PERFORM 9000-DISP-STATS-PARA
              THRU 9000-DISP-STATS-EXIT

           STOP RUN.
       0000-MAIN-EXIT.
      *--------------*
            EXIT.

       1000-OPEN-INIT-PARA.
      *-------------------*
           MOVE   '1000-OPEN-FILE-PARA'  TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           MOVE WHEN-COMPILED            TO  SIV-WHEN-COMPILED
           DISPLAY '***------------------------------------------***'
           DISPLAY ' PROGRAM  : RP30H44B'
           DISPLAY ' COMPILED : ' SIV-WHEN-COMPILED-DATE ', '
                                  SIV-WHEN-COMPILED-TIME
           DISPLAY ' PGM DESC : REPLACES MCF-DISCO-RPT-FLAG TO 4'
           DISPLAY '***------------------------------------------***'
           DISPLAY ' '

           OPEN INPUT REP-COST-SHP
           IF C-IORPCSHP-OK
              DISPLAY 'FILE OPEN SUCCESSFUL: REP-COST-SHP'
              MOVE 'Y' TO WS-IORPCSHP-OPN
           ELSE
              DISPLAY 'FILE OPEN ERROR: REP-COST-SHP'
              DISPLAY 'FILE STATUS  :' WS-IORPCSHP-FS
              PERFORM 9999-ABEND-PARA
                 THRU 9999-ABEND-EXIT
           END-IF

           OPEN I-O MSTR-COST-VSM
            IF C-IMSCSVSM-OK OR C-IMSCSVSM-OPEN-NORMAL
                DISPLAY 'FILE OPEN SUCCESSFUL: MSTR-COST-VSM'
                MOVE 'Y' TO WS-IMSCSVSM-OPN
            ELSE
                DISPLAY 'FILE OPEN ERROR: MSTR-COST-VSM'
                DISPLAY 'FILE STATUS  :' WS-IMSCSVSM-FS
                PERFORM 9999-ABEND-PARA
                THRU 9999-ABEND-EXIT
           END-IF

           INITIALIZE WS-REP-CSTSHP-REC
                      WS-INIT-VARS

           .
       1000-OPEN-INIT-EXIT.
      *-------------------*
            EXIT.

       2000-PROCESS-PARA.
      *-----------------*
           MOVE '2000-PROCESS-PARA' TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           PERFORM 2100-READ-REPCOST-PARA
              THRU 2100-READ-REPCOST-EXIT

           PERFORM 3000-UPDATE-MCFCOST-PARA
              THRU 3000-UPDATE-MCFCOST-EXIT
           .
       2000-PROCESS-EXIT.
      *-----------------*
            EXIT.

       2100-READ-REPCOST-PARA.
      *----------------------*
           MOVE '2100-READ-REPCOST-PARA' TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           READ REP-COST-SHP
            AT END
               IF WS-RPCSHP-REC-READ = 0
                  DISPLAY 'ERROR!!! EMPTY REP-COST-SHP'
                  PERFORM 9999-ABEND-PARA
                     THRU 9999-ABEND-EXIT
      *        ELSE
      *           MOVE 99999999             TO
               END-IF
            NOT AT END
               ADD 1                        TO WS-RPCSHP-REC-READ
           .
       2100-READ-REPCOST-EXIT.
      *----------------------*
            EXIT.

       3000-UPDATE-MCFCOST-PARA.
      *-----------------------*
           MOVE '3000-UPDATE-MCFCOST-PARA' TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           MOVE RD-TYP-BUS            TO MCF-TYPE-BUSINESS
           MOVE RD-ITEM-NO            TO MCF-ITEM-NUMBER
           MOVE ZEROES                TO MCF-DEAL-TAG
           MOVE SPACES                TO MCF-SCHEDULE-ID
REMOVE     DISPLAY 'RD-TYP-BUS                 : ' RD-TYP-BUS
REMOVE     DISPLAY 'RD-ITEM-NO                 : ' RD-ITEM-NO
REMOVE     DISPLAY 'MCF-RECORD-KEY BEFORE START: ' MCF-RECORD-KEY
           PERFORM 3500-MATCH-PARA
              THRU 3500-MATCH-EXIT.
           .
       3000-UPDATE-MCFCOST-EXIT.
      *-----------------------*
            EXIT.

       3500-MATCH-PARA.
      *-----------------------*
           START MSTR-COST-VSM KEY IS NOT LESS THAN MCF-RECORD-KEY
REMOVE     DISPLAY 'MCF-RECORD-KEY AFTER START: ' MCF-RECORD-KEY
              EVALUATE TRUE
                WHEN C-IMSCSVSM-OK
                  READ MSTR-COST-VSM NEXT RECORD
                  MOVE MCF-TYPE-BUSINESS TO WS-MCF-TYPE-BUSINESS
                  MOVE MCF-ITEM-NUMBER   TO WS-MCF-ITEM-NUMBER
                    IF RD-TYP-BUS      = WS-MCF-TYPE-BUSINESS AND
                       RD-ITEM-NO      = WS-MCF-ITEM-NUMBER
SANDY-              DISPLAY 'MCF RECORD KEY: ' MCF-RECORD-KEY
                    MOVE 4 TO MCF-DISCO-RPT-FLAG
                    REWRITE MCF-FILE-RECORD
                    DISPLAY 'DISCO-RPT-FLAG: ' MCF-DISCO-RPT-FLAG
                    ADD 1           TO WS-MATCH-RECS
                    ELSE
                    PERFORM 3500-MATCH-PARA
                       THRU 3500-MATCH-EXIT
                    END-IF
                WHEN C-IMSCSVSM-NOTFND
                     DISPLAY 'KEY NOT FOUND IN MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN C-IMSCSVSM-ENDFILE
                     DISPLAY 'END OF FILE REACHED - MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN OTHER
                     DISPLAY 'MCF VSAM ERROR: ' WS-IMSCSVSM-FS
                     PERFORM 9999-ABEND-PARA
                        THRU 9999-ABEND-EXIT
              END-EVALUATE
           .
       3500-MATCH-EXIT.
      *-----------------------*
            EXIT.
       9000-CLOSE-FILE-PARA.
      *--------------------*
           MOVE '9000-CLOSE-FILE-PARA' TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           IF WS-IMSCSVSM-OPN = 'Y'
              CLOSE MSTR-COST-VSM
           END-IF
           IF WS-IORPCSHP-OPN = 'Y'
              CLOSE REP-COST-SHP
           END-IF
           .
       9000-CLOSE-FILE-EXIT.
      *--------------------*
            EXIT.

       9000-DISP-STATS-PARA.
      *--------------------*
           MOVE '9000-DISP-STATS-PARA' TO WS-PARANAME
      D    DISPLAY WS-PARANAME

           DISPLAY '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
           DISPLAY '!!!!!!!! RP30H44B SUMMARY  !!!!!!!!!'
           DISPLAY '!!!!!!!! ================  !!!!!!!!!'
           DISPLAY '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
           DISPLAY '                                    '
           DISPLAY 'REPLACEMENT SHIPPING READ  : ' WS-RPCSHP-REC-READ
           DISPLAY 'MSTR COST FILE READ        : ' WS-MSCSVSM-REC-READ
           DISPLAY 'TOTAL RECORDS MATCHED      : ' WS-MATCH-RECS
           DISPLAY 'TOTAL RECORDS NOT MATCHED  : ' WS-MISMATCH-RECS
           DISPLAY 'TOTAL RECORDS WRITTEN      : '
           DISPLAY '                                    '
           DISPLAY '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
           .
       9000-DISP-STATS-EXIT.
      *--------------------*
            EXIT.

       9999-ABEND-PARA.
      *---------------*
           DISPLAY '*********************************************'
           DISPLAY '*******    ABEND    INFORMATION       *******'
           DISPLAY 'PARA NAME     :==>  '  WS-PARANAME
           DISPLAY '*********************************************'

           PERFORM 9000-CLOSE-FILE-PARA
              THRU 9000-CLOSE-FILE-EXIT
           MOVE 12 TO RETURN-CODE
           CALL 'ILBOABN0' USING RETURN-CODE
           .
       9999-ABEND-EXIT.
      *---------------*
            EXIT.


I am not very sure on the concept of START based on the key. The output that is displayed in the SPOOL is very differenct.
After the initial match of the 2 files, the same record of the VSAM file is getting read every time like below-

Code:

********************************* TOP OF DATA ******
0000-MAIN-PARA
1000-OPEN-FILE-PARA
***------------------------------------------***
 PROGRAM  : RP30H44B
 COMPILED : 02/04/14, 03.17.55
 PGM DESC : REPLACES MCF-DISCO-RPT-FLAG TO 4
***------------------------------------------***

FILE OPEN SUCCESSFUL: REP-COST-SHP
FILE OPEN SUCCESSFUL: MSTR-COST-VSM
2000-PROCESS-PARA
2100-READ-REPCOST-PARA
3000-UPDATE-MCFCOST-PARA
RD-TYP-BUS                 : 01
RD-ITEM-NO                 : 18413
MCF-RECORD-KEY BEFORE START: 01184130
MCF-RECORD-KEY AFTER START: 01184130
MCF RECORD KEY: 01184130CBASIC
DISCO-RPT-FLAG: 4
2000-PROCESS-PARA
2100-READ-REPCOST-PARA
3000-UPDATE-MCFCOST-PARA
RD-TYP-BUS                 : 01
RD-ITEM-NO                 : 38365
MCF-RECORD-KEY BEFORE START: 01383650
MCF-RECORD-KEY AFTER START: 01383650
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS
MCF-RECORD-KEY AFTER START: 01383660CHACPLUS


here, 38366 item no is present in input file only once but it is getting repeated in the SPOOL while i displayed it for debugging.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Feb 04, 2014 5:09 pm    Post subject: Reply to: Need to know the proper logic of START verb with R
Reply with quote

Why is this posted under SMS and VSAM instead of under COBOL?
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Tue Feb 04, 2014 5:17 pm    Post subject:
Reply with quote

START statement is just to place the cursor into the proper/required record, so that the next statement can process from there.

Code:
       3500-MATCH-PARA.
      *-----------------------*
           START MSTR-COST-VSM KEY IS NOT LESS THAN MCF-RECORD-KEY
REMOVE     DISPLAY 'MCF-RECORD-KEY AFTER START: ' MCF-RECORD-KEY
              EVALUATE TRUE
                WHEN C-IMSCSVSM-OK
                  READ MSTR-COST-VSM NEXT RECORD
                  MOVE MCF-TYPE-BUSINESS TO WS-MCF-TYPE-BUSINESS
                  MOVE MCF-ITEM-NUMBER   TO WS-MCF-ITEM-NUMBER
                    IF RD-TYP-BUS      = WS-MCF-TYPE-BUSINESS AND
                       RD-ITEM-NO      = WS-MCF-ITEM-NUMBER
SANDY-              DISPLAY 'MCF RECORD KEY: ' MCF-RECORD-KEY
                    MOVE 4 TO MCF-DISCO-RPT-FLAG
                    REWRITE MCF-FILE-RECORD
                    DISPLAY 'DISCO-RPT-FLAG: ' MCF-DISCO-RPT-FLAG
                    ADD 1           TO WS-MATCH-RECS
                    ELSE
                    PERFORM 3500-MATCH-PARA
                       THRU 3500-MATCH-EXIT
                    END-IF
                WHEN C-IMSCSVSM-NOTFND
                     DISPLAY 'KEY NOT FOUND IN MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN C-IMSCSVSM-ENDFILE
                     DISPLAY 'END OF FILE REACHED - MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN OTHER
                     DISPLAY 'MCF VSAM ERROR: ' WS-IMSCSVSM-FS
                     PERFORM 9999-ABEND-PARA
                        THRU 9999-ABEND-EXIT
              END-EVALUATE
           .
       3500-MATCH-EXIT.
      *-----------------------*
            EXIT.


The above code needs to change into below: Because READ VSAM file should be in the loop until non-matched record or end-of-file.

Code:
       3500-MATCH-PARA.
      *-----------------------*
           START MSTR-COST-VSM KEY IS NOT LESS THAN MCF-RECORD-KEY
REMOVE     DISPLAY 'MCF-RECORD-KEY AFTER START: ' MCF-RECORD-KEY
              EVALUATE TRUE
                WHEN C-IMSCSVSM-OK
                    MOVE 'Y'                    TO WS-VSAM-MATCH
                    PERFORM 3600-READ-VSAM      THRU 3600-EXIT
                            UNTIL WS-VSAM-MATCH = 'N'
                WHEN C-IMSCSVSM-NOTFND
                     DISPLAY 'KEY NOT FOUND IN MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN C-IMSCSVSM-ENDFILE
                     DISPLAY 'END OF FILE REACHED - MCF FILE: KEY - '
                                MCF-PARTIAL-KEY
                WHEN OTHER
                     DISPLAY 'MCF VSAM ERROR: ' WS-IMSCSVSM-FS
                     PERFORM 9999-ABEND-PARA
                        THRU 9999-ABEND-EXIT
              END-EVALUATE
           .
       3500-MATCH-EXIT.
      *-----------------------*
            EXIT.       


       3600-READ-VSAM.
           READ MSTR-COST-VSM NEXT RECORD
           EVALUATE TRUE
               WHEN C-IMSCSVSM-OK
                   MOVE MCF-TYPE-BUSINESS TO WS-MCF-TYPE-BUSINESS
                   MOVE MCF-ITEM-NUMBER   TO WS-MCF-ITEM-NUMBER
                   IF RD-TYP-BUS      = WS-MCF-TYPE-BUSINESS AND
                      RD-ITEM-NO      = WS-MCF-ITEM-NUMBER
SANDY-                 DISPLAY 'MCF RECORD KEY: ' MCF-RECORD-KEY
                       MOVE 4             TO MCF-DISCO-RPT-FLAG
                       REWRITE MCF-FILE-RECORD
                       DISPLAY 'DISCO-RPT-FLAG: ' MCF-DISCO-RPT-FLAG
                       ADD 1              TO WS-MATCH-RECS
                   ELSE
                       MOVE 'N'           TO WS-VSAM-MATCH 
                   END-IF
               WHEN C-IMSCSVSM-ENDFILE
                   MOVE 'N'               TO WS-VSAM-MATCH
               WHEN OTHER
                     DISPLAY 'MCF VSAM ERROR: ' WS-IMSCSVSM-FS
                     PERFORM 9999-ABEND-PARA
                        THRU 9999-ABEND-EXIT
           END-EVALUATE.
       3600-EXIT.
           EXIT.


don't forget to declare WS-VSAM-MATCH.

Hope this helps.
Back to top
View user's profile Send private message
sandeep kumar302

New User


Joined: 14 Mar 2012
Posts: 69
Location: India

PostPosted: Tue Feb 04, 2014 6:52 pm    Post subject:
Reply with quote

Thanks Suresh,
Yes it worked. thanks a lot again for your help and suggestions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Wildcard logic in COBOL dudenithy COBOL Programming 13 Thu Sep 01, 2016 7:36 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts Event-driven programming (BTS) VS (ST... Rohit Umarjikar CICS 2 Sat Jun 11, 2016 2:05 am
No new posts START Command in CICS amitc23 CICS 17 Fri Jun 03, 2016 3:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us