Page 1 of 2

Ucopy using JCL

PostPosted: Tue Sep 17, 2013 11:41 pm
by mahendrai
Hi All - Need help in ucopy

i am doing the ucopy jcl.. that is copying file from source to destination..

In the source location at each 1hr i will be getting one txt file that is for eg : txtFile.txt.. i need to copy txtFile.txt from source location and rename as txtFile_01_Date.txt to destination location.. again after 1hr i will be getting another txtFile.txt in source location which need to be copied to destination location as txtFile_02_Date.txt.. in the same day i will be getting 5 txt will the same name in source location which i need to copy to destination location with txtFile_01_Date.txt, txtFile_02_Date.txt so on.. please help me in JCL for above condition.

Re: Ucopy using JCL

PostPosted: Tue Sep 17, 2013 11:46 pm
by Akatsukami
It is unlikely that you will find meaningful assistance with what is basically a *nix issue on a z/OS board.

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 12:16 am
by Robert Sample
It is not clear what you are referring to -- do you mean the UUCP program in Unix, or is there some site-specific JCL that you are using called UCOPY? If the latter, you would be best going to someone working at your site for help as we are not likely to be familiar with the program.

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 12:27 am
by mahendrai
I need to copy similar .txt file from source location to destination location and rename the copied file..

Eg : SourceLocation/Customer.txt to DestinationLocation/Customer_01_18092013.txt

After 1hr i will be getting another Customer.txt in the same SourceLocation which need to be copied to destination location again
Eg : SourceLoation/Customer.txt to DestinationLocation/Customer_02_18092013.txt

Since In coming file Customer.txt is not fixed, depending on customer.txt coming per day in the source location we need to copy to destination location with _01_date.txt, _02_date.txt so on..

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 1:26 am
by Robert Sample
Your explanation is as clear as mud. When you say
Eg : SourceLocation/Customer.txt to DestinationLocation/Customer_01_18092013.txt
are SourceLocation and DestinationLocation on the same computer or different computers? Is SourceLocation or DestinationLocation a z/OS machine?

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 1:42 am
by mahendrai
Source Location is one server and DestinationLocation is other server...Copying the file from one server to other server...

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 2:45 am
by dick scherrer
Hello,

Neither here nor in your same topic on another forum have you provided anythng we can use to help you . . .

As was mentioned "there" your dataset names are not valid for z/OS so first you need to explain how this might work with JCL.

I'm sure you believe your request is quite clear. And it is. Bur Only to you. For us to help, we also must understand exactly what you have and what you want to do with it . . .

Show some mainframe JCL that already uses one of these files successfully.

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 4:03 am
by Robert Sample
You are bound and determined NOT to get any help, aren't you? Your answers are vague and non-specific even when asked specific questions -- if you cannot FULLY and ACCURATELY answer ALL of the questions below, this topic will be locked:

1. When you say "file", on a z/OS system that can refer to a sequential, partitioned, VSAM sequential, VSAM indexed, VSAM relative record, VSAM LDS, or Unix file. Which of these do you mean when you say "file"?

2. When you say "server", are you referring to a z/OS LPAR or a Windows server or a Unix server or a Linux server or something else you have not described?

3. For question 2, which type is the SourceLocation and which type is the DestinationLocation?

4. When you want to copy from server to server, are you planning on using REXEC or FTP or sFTP or something else you have not described?

5. You say you are "doing the ucopy JCL" -- post this JCL so we can see it. Use the Code button to preserve spacing.

6. How are you planning on keeping track of the number of files transferred since you will need to know that to generate the next file name?

7. When you say "txt" file, are you referring to a Windows / Unix ASCII text file? Are you aware that transferring this file to a z/OS system will change it to EBCDIC? Are you aware that changing an ASCII file to EBCDIC (or vice versa) will destroy any binary / packed decimal values in the file?

8. Is the file pure text or are there any language-specific symbols in it -- if so, what is the code page for the file? Is the file UTF-8 or Unicode?

Remember -- you have ONE chance to answer, in as much detail as you can, ALL of these questions, not just the numbered starting questions. If you fail to do so in your next post, this topic will be locked.

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 12:37 pm
by mahendrai
some thing like this

/UCMDOPT DD DSN=IC.D2C.UCMDOPT.FILE(UNV00001),DISP=SHR
//SYSIN DD *
-host
-userid
-x
-script SCRIPT
/*

//STEP01 EXEC P2CUCPY,COND=(0,NE)
//UNVOUT DD DSN=&&UCMDF01,DISP=(,PASS,DELETE),
// DCB=(SRCDSCB,BLKSIZE=0),
// SPACE=(CYL,(3300,300),RLSE)
//UCMDOPT DD DSN=IC.D2C.UCMDOPT.FILE(UNV00001),DISP=SHR
//SYSIN DD *
-cmd 'ucopy 'D:\JCL\Customer.txt'
-host
-userid
-x
-stdout -mode binary
/*

//STEP02 EXEC P2CUCPY,COND=(0,NE)
//UNVIN DD DISP=OLD,DSN=&&UCMDF01
//UCMDOPT DD DSN=IC.D2C.UCMDOPT.FILE(UNV00001),DISP=SHR
//SYSIN DD *
set H=%time:~0,2%
set M=%time:~3,2%
set S=%time:~6,2%
if %H% lss 10 (set H=0%time:~1,1%)
if %H% geq 10 (set H=%time:~0,2%)
ren Customer.txt ¬
Customer_%date:~10%%date:~4,2%%date:~7,2%_%H%%M%%S%.txt
-cmd 'ucopy > D:\FormatJCL\'
-stdin -mode binary
-host
-userid
-x

IF Customer_%date:~10%%date:~4,2%%date:~7,2%_%H%%M%%S%.txt Then
ren Customer_%date:~10%%date:~4,2%%date:~7,2%_%H%%M%%S%.txt ¬
Customer_01_%date:~10%%date:~4,2%%date:~7,2%_%H%%M%%S%.txt
ELSE
MAIL Notification

Re: Ucopy using JCL

PostPosted: Wed Sep 18, 2013 1:11 pm
by enrico-sorichetti
if You will not learn to post any useful info
I doubt You will get any useful answer, nor here nor in any other forum,

see here for a comment on a similar subject ( p2cucpy)
all-other-mainframe-topics/topic6780.html

anyway I did some research and looks like the product being discussed is from
http://www.stonebranch.com/" onclick="window.open(this.href);return false;

as per
http://www.stonebranch.com/images/techn ... amples.doc" onclick="window.open(this.href);return false;

a moderator delete the link if improper
( since it points to the vendor site the link seems legal)

anyway I wonder how the zOS jcl is going to be triggered :shock: