TomLiotta
8000 pts. | Oct 23 2009 12:44AM GMT
I have tried to create a file…
How? That is, what operation are you using to ‘create’ a ‘file’? What kind of file are you trying to create? Where are you trying to create it? Why are you using CPYTOPCD? (Perhaps because someone told you to?)
What do you want to do with the file? How is it supposed to be accessed?
A ‘file’ might be a database file, a ‘flat’ file, a stream file, or potentially any one of a variety of other kinds of files. The structures are different between them.
CPYTOPCD is related to a few possible kinds of files. It can potentially create a kind of streamfile that is intended for mostly obsolete purposes.
Tom
Kasten
15 pts. | Oct 23 2009 9:52AM GMT
As you probably figured out I’m fairly new at this. I’m changing an existing program and it uses the cpytopcd command. The file I’m writing to, using Except, contains one field(80). The file is to be used in another pc-system. All I have is a file layout. They need every record to be 80 char with space filling and CRLF.
The cpytopcd command looks like this:
CPYOTOPCD FROMFILE (QQFILE) TOFLR(’LE/INK’) TODOC(FEKBSE.TST) REPLACE(*YES) TRNFMT(*TEXT)
TomLiotta
8000 pts. | Oct 25 2009 10:56PM GMT
Well, it seems like a strange request since PC applications normally wouldn’t care about trailing spaces. However, if the file doesn’t contain anything but text characters, I’d probably use TRNFMT(*NOTEXT).
I know that sounds contradictory, but *NOTEXT should avoid trailing-blank truncation. I’m not clear on what the point of the character in position 80 is. I’d first suspect that it’s a placeholder — an attempt to retain spaces. I’d net think it was an identifying character that indicated what kind of record it was.
With *NOTEXT, though, you’d possibly need a record length of 82 and you’d have to put the CRLF characters into positions 81-82 yourself before copying.
What kind of data is going into the lines? Do you have a few sample lines from a valid version of the file you need to create?
Tom






