Skip to main content

[archive] SELECT with variable file name

  • February 18, 2009
  • 2 replies
  • 0 views

[Migrated content. Thread originally posted on 17 February 2009]

The following is permissable with another compiler. Is there an EASY way to accomplish the same thing with AcuCobol 8. It accepts a file name at run time before the open occurs. The file name accepted could be something like: C:\\DATA\\FILEX.txt


SELECT FILEIN ASSIGN TO "DUMMY" USING WS-FILE-NAME.

01 WS-FILE-NAME PIC X(50).

DISPLAY "ENTER FILE NAME: ".
ACCEPY WS-FILE-NAME.

OPEN INPUT FILEIN.

2 replies

[Migrated content. Thread originally posted on 17 February 2009]

The following is permissable with another compiler. Is there an EASY way to accomplish the same thing with AcuCobol 8. It accepts a file name at run time before the open occurs. The file name accepted could be something like: C:\\DATA\\FILEX.txt


SELECT FILEIN ASSIGN TO "DUMMY" USING WS-FILE-NAME.

01 WS-FILE-NAME PIC X(50).

DISPLAY "ENTER FILE NAME: ".
ACCEPY WS-FILE-NAME.

OPEN INPUT FILEIN.
Nevermind, I got it.

SELECT SOURCE-FILE ASSIGN TO WS-FILE-NAME
ORGANIZATION IS LINE SEQUENTIAL.

[Migrated content. Thread originally posted on 17 February 2009]

The following is permissable with another compiler. Is there an EASY way to accomplish the same thing with AcuCobol 8. It accepts a file name at run time before the open occurs. The file name accepted could be something like: C:\\DATA\\FILEX.txt


SELECT FILEIN ASSIGN TO "DUMMY" USING WS-FILE-NAME.

01 WS-FILE-NAME PIC X(50).

DISPLAY "ENTER FILE NAME: ".
ACCEPY WS-FILE-NAME.

OPEN INPUT FILEIN.
Nevermind, I got it.

SELECT SOURCE-FILE ASSIGN TO WS-FILE-NAME
ORGANIZATION IS LINE SEQUENTIAL.