Advertisement
Guest User

Untitled

a guest
Nov 29th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
COBOL 1.72 KB | None | 0 0
  1.        program-id. Program1 as "CPBOL_MASTERFILES.Program1".
  2.  
  3.        environment division.
  4.        input-output section.
  5.            file-control.   select inin assign to "C:\Users\1630955\Desktop\SHITS\First.txt" organization is line sequential.
  6.                            select outout assign to "C:\Users\1630955\Desktop\SHITS\COBOL_TRANS.txt"
  7.                            organization is indexed record key is custNO.
  8.        data division.
  9.        fd inin.
  10.        01 inf.
  11.            05 custNOI pic x(5).
  12.            05 custNAI pic x(20).
  13.            05 DOPI pic 9(8).
  14.            05 AOPI pic 9(9).
  15.            
  16.        fd outout.
  17.        01 outf.
  18.            05 custNO pic x(5).
  19.            05 custNA pic x(20).
  20.            05 DOP pic 9(8).
  21.            05 AOP pic 9(9).
  22.        
  23.        working-storage section.
  24.  
  25.        01 loopf pic x value 'y'.
  26.        01 selection pic 9.
  27.        
  28.        01 custNumber pic 9(5).
  29.        01 custName pic x(20).
  30.        01 custDOP pic 9(8).
  31.        01 custAOP pic 9(5).
  32.        
  33.        procedure division.
  34.        open input inin
  35.        open output outout
  36.        
  37.        perform until loopf = "n"
  38.        read inin
  39.            at end
  40.            move "n" to loopf
  41.            
  42.            not at end
  43.            write outf
  44.                invalid key
  45.                    display custNO"  Already exist"
  46.                not invalid key
  47.                   move space to outf
  48.            move custNOI to custNO
  49.            move custNAI to custNA
  50.            move DOPI to DOP
  51.            move AOPI to AOP
  52.            end-write
  53.        
  54.  
  55.            
  56.        end-read
  57.        end-perform
  58.        close inin
  59.        close outout
  60.            stop run.
  61.            
  62.          end program Program1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement