COBOL NEWLINE

Sort:
You are not authorized to post a reply.
Author
Messages
slm4
Basic Member
Posts: 13
Basic Member
    I have a program that writes out variable length records with maximum length of 3700 bytes.
    For some reason file is being written as one line.  No newlines.  Can someone help. 
    Ragu Raghavan
    Veteran Member
    Posts: 469
    Veteran Member
      Assuming you are on Unix/Windows, how is the file defined in workdef ? Sequential or Tape ?
      JimY
      Veteran Member
      Posts: 510
      Veteran Member
        The select statement in File control has to have the organization set to line sequential.

        
        ORGANIZATION IS LINE SEQUENTIAL
        
        John Henley
        Senior Member
        Posts: 3348
        Senior Member
          Posted By slm4 on 11/29/2012 03:41 PM
          I have a program that writes out variable length records with maximum length of 3700 bytes.
          For some reason file is being written as one line.  No newlines.  Can someone help. 

          Are you writing to a Lawson work file (e.g. defined via workdef)?
          If so, what "file media" option are you using?
          Thanks for using the LawsonGuru.com forums!
          John
          LauraP
          Advanced Member
          Posts: 28
          Advanced Member
            I've had to do this alot ..

            You can define a one position field in the last position of the record you are writing out to force a CR/LF at the end of the line.

            Set up the field as Filler  Pic X(1)  Value X'0D0A'.   (two hex characters take up one physical position).  This will force a CR/LF at the end of each line.

            OR if you are doing this through Lawson you can use the cnvexp command (type it at the command line and it will give you the format).
            You are not authorized to post a reply.