sftp ascii text file to mainframe

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
tsgb25
Posts: 8
Joined: Thu Feb 06, 2014 6:22 am

sftp ascii text file to mainframe

Post by tsgb25 »

We are transfering a text file of policies from linux to a z/OS mainframe using a get job on the mainframe. The linux file has a trailer record that has hex 'FF' in the first 10 characters of the record. When we used plain ftp this transferred to the mainframe correctly - i.e had hex 'FF' in the first 10 characters of the trailer record in the z/OS file. When we use sftp, these characters get translated to hex 'DF' in the mainframe file which means that when the file is sorted on the mainframe the trailer record gets moved towards the top of the file. Any suggestions?
This is the coz:sftp options in effect for the job (which we use for all our other sftp's):
cozsftp> lzopts mode=text,servercp=ISO8859-1,clientcp=IBM285
clientcp=IBM285 mode=text servercp=ISO8859-1
cozsftp> lzopts linerule=lf
linerule=lf
cozsftp> lzopts notrim
notrim
cozsftp> lzopts -a
clientcp=IBM285 conddisp=catlg estsize jeslrecl=80
jesowner=OPSUNIX jesrecfm=f jesstatus=* linerule=lf
loglevel=I mode=text replace servercp=ISO8859-1
smf NOblksize NObufno NOcopies
NOdataclas NOdest NOdir NOdisp
NOdsntype NOdsorg NOforms NOgdgnt
NOhold NOjesblksize NOjesjobname NOjesjobwait
NOlabel NOlike NOlrecl NOmaxcscnt
NOmaxvol NOmgmtclas NOmount NOnorecall
NOoutdes NOoverflow NOpad NOrecfm
NOrelease NOreqexits NOreset NOretpd
NOsequence NOshowall NOspace NOspin
NOstorclas NOsysout NOtechnique NOtrim
NOtrtab NOtrtch NOucount NOunit
NOunixls NOvol NOwriter
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp ascii text file to mainframe

Post by dovetail »

What you are seeing is working as expected.

You can display the translate table that will be used for your session by issuing the "showtrtab" command from a z/OS Unix shell (this command is in <coz_inst>/bin).

Code: Select all

>showtrtab -t IBM285 -s ISO8859-1                                                                                
00:  00 01 02 03   37 2D 2E 2F   16 05 15 0B   0C 0D 0E 0F 
10:  10 11 12 13   3C 3D 32 26   18 19 3F 27   1C 1D 1E 1F 
20:  40 5A 7F 7B   4A 6C 50 7D   4D 5D 5C 4E   6B 60 4B 61 
30:  F0 F1 F2 F3   F4 F5 F6 F7   F8 F9 7A 5E   4C 7E 6E 6F 
40:  7C C1 C2 C3   C4 C5 C6 C7   C8 C9 D1 D2   D3 D4 D5 D6 
50:  D7 D8 D9 E2   E3 E4 E5 E6   E7 E8 E9 B1   E0 BB BA 6D 
60:  79 81 82 83   84 85 86 87   88 89 91 92   93 94 95 96 
70:  97 98 99 A2   A3 A4 A5 A6   A7 A8 A9 C0   4F D0 BC 07 
80:  20 21 22 23   24 25 06 17   28 29 2A 2B   2C 09 0A 1B 
90:  30 31 1A 33   34 35 36 08   38 39 3A 3B   04 14 3E FF 
A0:  41 AA B0 5B   9F B2 6A B5   BD B4 9A 8A   5F CA AF A1 
B0:  90 8F EA FA   BE A0 B6 B3   9D DA 9B 8B   B7 B8 B9 AB 
C0:  64 65 62 66   63 67 9E 68   74 71 72 73   78 75 76 77 
D0:  AC 69 ED EE   EB EF EC BF   80 FD FE FB   FC AD AE 59 
E0:  44 45 42 46   43 47 9C 48   54 51 52 53   58 55 56 57 
F0:  8C 49 CD CE   CB CF CC E1   70 DD DE DB   DC 8D 8E DF 
If you would like to use the same translate tables as IBM FTP, you can do that with the "trtab" option:
http://dovetail.com/docs/sftp/options.h ... ns_general

to display that for the "STANDARD" FTP table:

Code: Select all

>showtrtab -T STANDARD

ASCII-to-EBCDIC table
00:  00 01 02 03   37 2D 2E 2F   16 05 25 0B   0C 0D 0E 0F 
10:  10 11 12 13   3C 3D 32 26   18 19 3F 27   22 1D 35 1F 
20:  40 5A 7F 7B   5B 6C 50 7D   4D 5D 5C 4E   6B 60 4B 61 
30:  F0 F1 F2 F3   F4 F5 F6 F7   F8 F9 7A 5E   4C 7E 6E 6F 
40:  7C C1 C2 C3   C4 C5 C6 C7   C8 C9 D1 D2   D3 D4 D5 D6 
50:  D7 D8 D9 E2   E3 E4 E5 E6   E7 E8 E9 AD   E0 BD 5F 6D 
60:  79 81 82 83   84 85 86 87   88 89 91 92   93 94 95 96 
70:  97 98 99 A2   A3 A4 A5 A6   A7 A8 A9 C0   4F D0 A1 07 
80:  00 01 02 03   37 2D 2E 2F   16 05 25 0B   0C 0D 0E 0F 
90:  10 11 12 13   3C 3D 32 26   18 19 3F 27   22 1D 35 1F 
A0:  40 5A 7F 7B   5B 6C 50 7D   4D 5D 5C 4E   6B 60 4B 61 
B0:  F0 F1 F2 F3   F4 F5 F6 F7   F8 F9 7A 5E   4C 7E 6E 6F 
C0:  7C C1 C2 C3   C4 C5 C6 C7   C8 C9 D1 D2   D3 D4 D5 D6 
D0:  D7 D8 D9 E2   E3 E4 E5 E6   E7 E8 E9 AD   E0 BD 5F 6D 
E0:  79 81 82 83   84 85 86 87   88 89 91 92   93 94 95 96 
F0:  97 98 99 A2   A3 A4 A5 A6   A7 A8 A9 C0   4F D0 A1 07 

EBCDIC-to-ASCII table
00:  00 01 02 03   1A 09 1A 7F   1A 1A 1A 0B   0C 0D 0E 0F 
10:  10 11 12 13   1A 0A 08 1A   18 19 1A 1A   1C 1D 1E 1F 
20:  1A 1A 1C 1A   1A 0A 17 1B   1A 1A 1A 1A   1A 05 06 07 
30:  1A 1A 16 1A   1A 1E 1A 04   1A 1A 1A 1A   14 15 1A 1A 
40:  20 A6 E1 80   EB 90 9F E2   AB 8B 9B 2E   3C 28 2B 7C 
50:  26 A9 AA 9C   DB A5 99 E3   A8 9E 21 24   2A 29 3B 5E 
60:  2D 2F DF DC   9A DD DE 98   9D AC BA 2C   25 5F 3E 3F 
70:  D7 88 94 B0   B1 B2 FC D6   FB 60 3A 23   40 27 3D 22 
80:  F8 61 62 63   64 65 66 67   68 69 96 A4   F3 AF AE C5 
90:  8C 6A 6B 6C   6D 6E 6F 70   71 72 97 87   CE 93 F1 FE 
A0:  C8 7E 73 74   75 76 77 78   79 7A EF C0   DA 5B F2 F9 
B0:  B5 B6 FD B7   B8 B9 E6 BB   BC BD 8D D9   BF 5D D8 C4 
C0:  7B 41 42 43   44 45 46 47   48 49 CB CA   BE E8 EC ED 
D0:  7D 4A 4B 4C   4D 4E 4F 50   51 52 A1 AD   F5 F4 A3 8F 
E0:  5C E7 53 54   55 56 57 58   59 5A A0 85   8E E9 E4 D1 
F0:  30 31 32 33   34 35 36 37   38 39 B3 F7   F0 FA A7 FF 
tsgb25
Posts: 8
Joined: Thu Feb 06, 2014 6:22 am

Re: sftp ascii text file to mainframe

Post by tsgb25 »

thankyou for the trtab option.

The SFTP in question is going from ASCII to EBCDIC and using the STANDARD table this has converted FF to 07.

Our current FTP keeps the FF as FF, so for SFTP is there a table that would keep FF as FF or would we have to create a specific one?
tsgb25
Posts: 8
Joined: Thu Feb 06, 2014 6:22 am

Re: sftp ascii text file to mainframe

Post by tsgb25 »

To get round our problem:
We have now created a customized translation table data set on the mainframe using as a base the standard TCPIP.STANDARD.TCPXLBIN file.
This customized file table translates ascii FF to ebcdic FF.
Thanks again for pointing us in the right direction.
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: sftp ascii text file to mainframe

Post by dovetail »

I guess I don't understand. If you were using a customized table for FTP (and not STANDARD), then you can use the same FTP table with Co:Z SFTP.

I'm glad you were able to resolve it.
tsgb25
Posts: 8
Joined: Thu Feb 06, 2014 6:22 am

Re: sftp ascii text file to mainframe

Post by tsgb25 »

We were using Computer Associates implementation of the IP stack (TCPAccesss) - their default ascii/ebcdic translate table has about a dozen differences to the default IBM TCPIP stack translate table. We have created a new binary translate table based on the CA one.
Post Reply