Copy a text file from Windows to unix



Copy a text file from Windows to unix

Postby Rahul Bharadwaj » Mon Apr 22, 2013 4:09 pm

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
Rahul Bharadwaj
 
Posts: 1
Joined: Mon Apr 22, 2013 3:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Copy a text file from Windows to unix

Postby Robert Sample » Mon Apr 22, 2013 5:15 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Copy a text file from Windows to unix

Postby Rajesh K » Mon Apr 22, 2013 8:59 pm

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?
Rajesh K
 
Posts: 7
Joined: Mon Apr 22, 2013 2:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Copy a text file from Windows to unix

Postby Akatsukami » Mon Apr 22, 2013 9:00 pm

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.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Copy a text file from Windows to unix

Postby Robert Sample » Mon Apr 22, 2013 9:21 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to Off-Topics

 


  • Related topics
    Replies
    Views
    Last post