Page 1 of 1

Copy a text file from Windows to unix

PostPosted: Mon Apr 22, 2013 4:09 pm
by Rahul Bharadwaj
Hi All

I am trying to copy a file from Windows server to Unix Server using JCL code.

//CPYFR01 EXEC CPYUTIL
//UNVOUT DD DSN=&&UCMDFR01,DISP=(,PASS,DELETE),
// DCB=(BLKSIZE=70000,LRECL=2048,RECFM=FB),
// UNIT=SYSDA,
// SPACE=(2048,(500,500),RLSE),AVGREC=K
//UCMDOPT DD DISP=SHR,DSN=IC.D2C.UCMDOPT.FILE(WINUSERID)
//SYSIN DD *
-host WindowsServerName
-userid WINUSERID
-x UCMDOPT
-cmd "UCOPY \\SOURCESERVER\PATH1\ABC.txt"
//CPYTO01 EXEC CPYUTIL
//UNVIN DD DSN=&&UCMDFR01,DISP=OLD
//UCMDOPT DD DISP=SHR,DSN=IC.D2C.UCMDOPT.FILE(UNXUserID)
//SYSIN DD *
-cmd "ucopy > /app/path1/ABC.txt"
-host UnixServerName
-userid UNXUserID
-x UCMDOPT
-stdout -mode binary
/*

The Record delimiter of the file is automatically getting converted from 'CRLF' (dos format) to 'LF' (unix format)

Is there any way to transfer the file from Windows to Unix server without changing the Record Delimiter?

Thanks in Advance.

Regards
Rahul

Re: Copy a text file from Windows to unix

PostPosted: Mon Apr 22, 2013 5:15 pm
by Robert Sample
How is this a mainframe issue?

Talk to your site support group, or whoever supports the CPYUTIL function (which is NOT a standard part of z/OS), on how to do a binary transfer. The default line terminator for Windows is CR/LF and the default line terminator for Unix is LF so the behavior you are seeing is normal and expected.

Re: Copy a text file from Windows to unix

PostPosted: Mon Apr 22, 2013 8:59 pm
by Rajesh K
Robert Sample wrote:How is this a mainframe issue?

Talk to your site support group, or whoever supports the CPYUTIL function (which is NOT a standard part of z/OS), on how to do a binary transfer. The default line terminator for Windows is CR/LF and the default line terminator for Unix is LF so the behavior you are seeing is normal and expected.



Hi,

Can I have a sort card to have the matched records in two files if possible?

Re: Copy a text file from Windows to unix

PostPosted: Mon Apr 22, 2013 9:00 pm
by Akatsukami
Rajesh K wrote:
Robert Sample wrote:How is this a mainframe issue?

Talk to your site support group, or whoever supports the CPYUTIL function (which is NOT a standard part of z/OS), on how to do a binary transfer. The default line terminator for Windows is CR/LF and the default line terminator for Unix is LF so the behavior you are seeing is normal and expected.



Hi,

Can I have a sort card to have the matched records in two files if possible?

No.

Re: Copy a text file from Windows to unix

PostPosted: Mon Apr 22, 2013 9:21 pm
by Robert Sample
Rajesh K, you have been given your answer. Do not attempt to hijack other posts to get what you want; none of the senior people on this forum have provided you a sort statement and it is EXTREMELY unlikely at this point that any will. Hence any sort statement you get is more likely to come from somebody with no more experience then you have and that reduces the chances of it being correct to very low.