On Thu, Aug 24, 2017 at 3:14 AM, venkat kulkarni <[email protected]> wrote: > my dataset on Mainframe is FB , So whenever mainframe transfer data using > FTP using ascii to AIX it doesnt have trailing spaces. > > But as SFTP cant transfer directly dataset into AIX location, so we > transfer dataset to omvs location using OPUT and then from omvs, we > transfer data to AIX using SFTP. > > So, I think, while transferring data from dataset to omvs it add trailing > blanks and which carry forward to unix as well.
Technically, the blanks are already there in an FB data set, so OPUT is _preserving_ existing trailing blanks. FTP, with the option NOTRAILINGBLANKS, will remove these existing trailing blanks, whereas sftp will not remove them. There are a couple of things you can to. If you are forced to only use standard IBM z/OS UNIX facilities, then you can use the "cp" and "sed" commands to transfer the data in the DSN to a UNIX file. For example: If your OPUT looks something like: OPUT 'SOME.DATA.SET.NAME' '/u/myid/transfer/unix.file.name.txt' TEXT You could replace it by using the OSHELL command. I am not using BPXBATCH instead of IKJEFT01 to minimize the number of changes for the OP. OSHELL cp "//'SOME.DATA.SET.NAME' " /dev/fd/1 | + sed -E 's/ *$//;' >/u/myid/transfer/unix.file.name.txt Personally, I would install Dovetailed Technologies' "data set pipes" from http://dovetail.com/downloads/coz/index.html. This software can be used without any kind of fee or license. You need not even register it. It comes with a UNIX command called "fromdsn". Still using OSHELL instead of, and assuming that the proper directories are on the UNIX ${PATH}, you could do: OSHELL fromdsn -K SOME.DATA.SET.NAME >/u/myid/transfer/unix.file.name.txt Note that "fromdsn" does not normally prefix the DSN with your TSO id. So the DSN is not enclosed in ' characters. > Mainframe to AIX rather then first trasnferring to omvs and then to aix. -- If you look around the poker table & don't see an obvious sucker, it's you. Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
