Converting LF's to NL's in variable length records

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
cvs
Posts: 7
Joined: Mon Jan 16, 2012 3:17 pm

Converting LF's to NL's in variable length records

Post by cvs »

I am using the following script to retrieve a PGP encrypted file with variable legth records from a Unix server:

ssh_opts="-oBatchMode=no"
ssh_opts="$ssh_opts -oConnectTimeout=60"
ssh_opts="$ssh_opts -oServerAliveInterval=60"
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no"
ssh_opts="$ssh_opts -oPreferredAuthentications=password"
ssh_opts="$ssh_opts -oPort=22"
cozsftp $ssh_opts -b- $remoteuser@$server <<EOB
lzopts mode=text,trim,servercp=$servercp,linerule=flexible
cd test
pwd
ls -al
get $remotefile $localfile
EOB

The file is then decrypted to a file to that is defined as VB with LRECL of 3000.
I see that the LF's are converted to NL, hex below is 15, but doesn't go to a NL. The record continues to the EOL where the NL is done:
4:00"."15581"
F7FF717FFFFF7
4A00F5F15581F
NL's do not appear to be working.
When I retrieve the file as text without encryption the file looks OK.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Converting LF's to NL's in variable length records

Post by dovetail »

A PGP encrypted file is a binary stream of bytes. If you transfer it, you must use mode=binary.

The problem that you are having may be related to the mainframe PGP product - apparently it decrypts and then can translate from ASCII to EBCIDIC, converting newlines to records.
Post Reply