Skip to main content

Problem:

I'm getting a return File Status code of 35 with a spacey directory/file name:

     MOVE 'C:\\PROGRAM FILES\\SAMPLEFILE.TXT' TO WS-FILE.       

                                            

Resolution:

When using dynamic file assignment, you need to use double quotes for spacey paths.

If you were using static file assignment it isn't necessary-

Because of the spacey path you need to change this move statement

      MOVE 'C:\\PROGRAM FILES\\SAMPLEFILE.TXT' TO WS-FILE

to add " s around the file path and name (i.e. single quote double quote)

      MOVE '"C:\\PROGRAM FILES\\SAMPLEFILE.TXT"' TO WS-FILE

The following example shows how to use quotes to create the file spacey filename.dat, where the filename contains spaces:

select f1

    assign to dynamic f1-name.

...

working-storage section.

01 f1     pic x(30).

...

move """spacey  filename.dat""" to f1-name

....

open output f1.

Old KB# 7077