0

I am learning Cobol and I am struggling with declaring my file path. In the Environment Division I have the following code

SELECT Sales-File ASSIGN to 
     "C:\Users\Bogdan\Desktop\Program Cobol\Modul 14\AROMASALES.RPT"

MY File Path is too big for one line , so I should have a continuation Line. I have tried everything I could , but so far breaking the path in two lines is not working. Can you tell me atleast if it's possible to break the file path in 2 rows? Thank you !

I am sorry for my mistakes, it's my first post here. The Compiler is OpenCobol, with the 72 column format(I thought that all cobol compilers have this 72 column rule). I am trying to read a file which has a path too long for this 72 column format . I know I can change the file location, but I am wondering if , by any means, I can use a path as long as in my example.

SELECT StudentFile ASSIGN
    TO "C:\Users\BLABLA\Desktop\Program Cobol\Modul 13\Scripts\Salutare"
    ORGANIZATION IS LINE SEQUENTIAL.
lurker
  • 56,987
  • 9
  • 69
  • 103
BogdanP
  • 13
  • 1
  • 6
  • 1
    Please read [How to ask](https://stackoverflow.com/help/how-to-ask) and provide a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – buhtz Jan 08 '18 at 14:21
  • While line continuation or literal concatenation should work (we'd need the compiler you use + the sample that doesn't work to help you finding out "why") the normal way is to use an external file name (the actual file path is specified outside of the program) or the easiest way: don't specify a path at all, the program should use whatever path you starting it from (for example current directory of a cmd line). – Simon Sobisch Jan 08 '18 at 21:56
  • @BogdanP: "I have tried everything I could" - please post the code of what you have tried or leave a comment when a comment helped you to solve this question already. – Simon Sobisch Jan 14 '18 at 10:07

1 Answers1

2

Normal continuation is done by :

  • writing your string up to col 72 (no closing quote)
  • on the next line, put a hyphen ('-') in col 7
  • on the same line, continue your string with an opening quote
David Larochette
  • 1,200
  • 10
  • 18