Hi Michael,
When I hit F10 to display HEX and navigate to the end of the record I
see x'25' at the end of each record (Line Feed).
That's the standard way of writing text files on Unix systems. Each
line of text ends in a line feed character (which is x'25' in EBCDIC, or
x'0A' in ASCII)
Windows uses a slightly different convention, where every line ends two
characters, CR and LF, which is x'0d25' in EBCDIC or x'0d0a' in ASCII.
When I use the CPY command to put this file out on a
Windows share, I specify the following :
CPY OBJ('/From path/filename.txt') TODIR('/to path') TOCCSID(*PCASCII)
DTAFMT(*TEXT)
While that'll do ASCII/EBCDIC translation, it has no notion of
translating the end-of-line conventions from Unix to Windows.
When I look at the file on the PC (notepad), I see the file is converted
but the lines wrap. I bring the file in DEBUG and see that only x'0A'
(Line Feed) is in the file. I think that I need to have x'0D' (CR) also.
Is there a way with CPY that will format the file as such?
No, CPY has no notion of doing that.
Try opening the file in Wordpad on Windows (it understands both Unix and
Windows text formats). It should look correct there.
If that's not good enough, and you need CRLF, then there are various
ways of solving that problem. One easy way (but a way that I don't like
) is to copy the stream file to a PF via CPYFRMSTMF and then copy it
back with CPYTOSTMF. CPYTOSTMF lets you choose whether you want LF only
or CRLF at the end of each line.
I don't like going to a PF, though. It means doing ASCII/EBCDIC
translation both forwards and backwards, and that runs the risk of a
mistranslation. It also means converting to a fixed-length record
format, and back again, which runs the risk of having problems if data
in a stream file doesn't fit in the PF record (record length too short)
plus it will inevitably strip trailing blanks from the record.
There are lots of ways of adding a x'0d' before every x'25'. You could
write a program to do that, of course. You could do it with QShell.
You could download a free utility like the unix2dos utility... There
are many ways. But, I'll wait to see if you want my help finding one
before putting any more effort into this :)
Also, another quick IFS question that I think I know the answer but just
checking. The file that I am copying is owned by the QNOTES ID. I set
the folder rights to have a NotesADM group to have *RWX and *ALL object
level. I then put the user that is issuing the CPY in the NotesADM group
but I've been getting security errors. Question : is group membership
used in the IFS at V5R3? If not, is it supported at V5R4 or V6R1?
Group membership is supported in the IFS from it's inception in V3R1.
But, having rights to the directory doesn't necessarily give you rights
to the file itself. Check that the group profile running the CPY
command has *R access to the file as well as *RX access to the directory
(*RWX is higher access than *RX, and will work)
As an Amazon Associate we earn from qualifying purchases.