skip to main content

Library Routines : C$CREATE_TMP_FILE

C$CREATE_TMP_FILE
The C$CREATE_TMP_FILE library routine creates a temporary file and returns its name.
The file will be handled as a normal sequential file whose physical name is the one returned by the routine. The program logic must take care of deleting the file when it’s no more necessary.
Syntax
 CALL "C$CREATE_TMP_FILE" USING fileName
Parameters
Return code:
returnCode can be any numeric data item and provides additional information:
fileName is missing or it is not big enough to store the full path-name, the file is removed
Examples:
Example - Create temporary file to store some customers data
working-storage section.
77 dest-file pic x(512).
77 retCode   pic s9(5).
procedure division.
   call "c$create_tmp_file" using
        dest-file "cust_" ".tmp" "/myapp/tmp"
        giving retCode
   if retCode = 0
      display message "Temp file was created"
   else
      display message "Error creating temp file"
   end-if.

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