1

I am using MicroFocus Cobol on Windows OS. Please is there any possibility to have Unicode chars in filename, and use this file in Cobol. Like this:

select optional intb-file assign to f-intb-file
file status is w-file-status.

DATA DIVISION.
FILE SECTION.

fd intb-file
value of id f-intb-file.
copy "sxintrc.cpy".

WORKING-STORAGE SECTION.

01 FILE-NAMES.
05 f-intb-file pic n(100) value spaces.

I got this error: COBCH0258S ASSIGN data-name F-INTB-FILE illegal

Pavel Matras
  • 329
  • 1
  • 5
  • 13
  • What happens if you move the variable `f-intb-file` one level down´, define a new `05 f-intb-file-x` as its parent and use this parent item in the `ASSIGN`? – Simon Sobisch Jan 17 '18 at 18:23
  • I try it, compile is now without error. But I can't open file in program. Got file-status 35 - file is not present. I thinkl it's because parent variable is taken as PIC X. So for example if this is child `10 f-intb-file pic n(100) value "file.txt"` In parent variable i got `f i l e . t x t `, because 2B Unicode – Pavel Matras Jan 18 '18 at 11:12
  • This is a known restriction in the Micro Focus COBOL compilers. – Stephen Gennard Jan 18 '18 at 12:51
  • You don't need a national variable for `f i l e . t x t`. If you need it it *may* work to use `ASSIGN TO 'NATFILE'` and set `DD_DATFILE` via environment. – Simon Sobisch Jan 18 '18 at 15:54

0 Answers0