skip to main content

Procedure Division Statements : RELEASE

RELEASE
General Format
RELEASE Record-name-1 [ FROM {Identifier-1} ]
Syntax rules
1.
2.
3.
General rules
1.
2.
3.
A.
 
MOVE identifier-1 TO record-name-1
 
or
 
MOVE literal-1 TO record-name-1
 
according to the rules specified for the MOVE statement.
B.
4.
Examples
Use Release on input procedure of Sort to provide input records
 input-output section.
 file-control.
   select work-file assign to "sort-workfile".
 file section.
 sd work-file.
 01 work-rec.
    03 wr-key-1 pic x(5).
    03 wr-key-2 pic x(5).
 working-storage section.
 01 eof-flag pic x.
    88 eof-sort value "Y" false "N".
 procedure division.
  display x"0d0a" "First sort descending on key 1, ascending on key 2"
  sort work-file on descending key wr-key-1
       input procedure is input-proc
       output procedure is output-proc.
  display x"0d0a" "Second sort descending on key 2, ascending on key 1"
  sort work-file on descending key wr-key-2
       input procedure is input-proc
       output procedure is output-proc.
  goback.
     release work-rec from "aaaaabbbb1"
     release work-rec from "aaaaazzzz2"
     release work-rec from "ccccczzzz3"
     release work-rec from "cccccdddd4"
     release work-rec from "cccccmmmm5"
     release work-rec from "zzzzzcccc6"
     release work-rec from "zzzzzaaaa7"
     release work-rec from "zzzzznnnn8".
      set eof-sort to false
      perform until eof-sort
        return work-file
         at end set eof-sort to true
         not at end display work-rec
      end-perform.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left