Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program-id. Program1 as "CPBOL_MASTERFILES.Program1".
- environment division.
- input-output section.
- file-control. select inin assign to "C:\Users\1630955\Desktop\SHITS\First.txt" organization is line sequential.
- select outout assign to "C:\Users\1630955\Desktop\SHITS\COBOL_TRANS.txt"
- organization is indexed record key is custNO.
- data division.
- fd inin.
- 01 inf.
- 05 custNOI pic x(5).
- 05 custNAI pic x(20).
- 05 DOPI pic 9(8).
- 05 AOPI pic 9(9).
- fd outout.
- 01 outf.
- 05 custNO pic x(5).
- 05 custNA pic x(20).
- 05 DOP pic 9(8).
- 05 AOP pic 9(9).
- working-storage section.
- 01 loopf pic x value 'y'.
- 01 selection pic 9.
- 01 custNumber pic 9(5).
- 01 custName pic x(20).
- 01 custDOP pic 9(8).
- 01 custAOP pic 9(5).
- procedure division.
- open input inin
- open output outout
- perform until loopf = "n"
- read inin
- at end
- move "n" to loopf
- not at end
- write outf
- invalid key
- display custNO" Already exist"
- not invalid key
- move space to outf
- move custNOI to custNO
- move custNAI to custNA
- move DOPI to DOP
- move AOPI to AOP
- end-write
- end-read
- end-perform
- close inin
- close outout
- stop run.
- end program Program1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement