support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets
 

Veryant Knowledge Base
Home > All Categories > isCOBOL General > Deployment > Working with sequential files on Pipes
Question Title Working with sequential files on Pipes

Piping it is allowed for file declared as:
a) printer file (ASSIGN TO PRINTER)
b) line sequential file (assuming to compile with -flsu) in all other cases (relative file, binary sequential file etc) piping it is not allowed.

Here a simple program:


       program-id. pipe.
       environment division.
       input-output section.
       file-control.
           select my-file assign to printer '-p sh -c cat>pipe.txt'.
       data division.
       file section.
       fd my-file.
       01 my-rec pic x(60).
       procedure division.
       main.
           open output my-file.
           write my-rec from "abcdefghijk" .
           write my-rec from "01234567890" 
           close my-file.

Some hints:


a) how to remove EOL termination characters removing trailing spaces
In same cases could be request to remove EOL from piping file. In order to do that it is useful to add "NO CONTROL" in WRITE statements:

           open output my-file.
           write my-rec from "abcdefghijk" NO CONTROL .
           write my-rec from "01234567890" NO CONTROL
           close my-file.

b) some characters are missing in pipe files.
In case that UNICODE internal conversion (default behavior with -P) is unable to convert some characters, that could happen if binary data are used, +P should be used instead because it prevent UNICODE conversion.

 select my-file assign to printer '+p sh -c cat>prova.txt'.

c) how to remove EOL and maintains trailing spaces
In same cases could be request to remove EOL from piping file and maintains the trailing spaces. In order to do that it is useful to add "NO CONVERSION" in WRITE statements:

           open output my-file.
           write my-rec from "abcdefghijk" NO CONVERSION .
           write my-rec from "01234567890" NO CONVERSION .
           close my-file.
Authored by: Veryant Support This question has been viewed 5370 times so far.
Click Here to View all the questions in Deployment category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. Did you know you can create temporary files in memory?
  2. What are the minimum files I need for a runtime-only installation? How do I create a launcher?
  3. How can I encode a URL String?
  4. Did you know isCOBOL IDE allows you to easily understand how to invoke a method in a Java Class?
  5. How do I generate an executable for deployment?
  6. What can I use to perform an email validation during entry-field accept?
  7. How do I create an installation package for my COBOL application?
  8. Is there a way to to emulate the W$GETC routine?
  9. Did you know isCOBOL IDE allows you to easily understand how to invoke a method in a Java Class?
  10. Did you know you could choose from different languages for isCOBOL message?
  11. Did you know you could set a background image from isCOBOL IDE's painter?
  12. How can I read data correctly from a line-sequential file that has a different encoding from the one used by isCOBOL?
  13. Did you know these two ways of finding out the working directory in use?
  14. Can I mix versions of Java, isCOBOL compiler and isCOBOL runtime?
  15. How can I read a data written with a different encoding?
Article Information Additional Information
Article Number: 219
Created: 2013-11-21 9:00 AM
Rating: 1 Star
 
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
 
Search Knowledge Base Search Knowledge Base



 
 

© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.