Page 1 of 2

IDCAMS query

PostPosted: Sat Feb 18, 2012 10:29 pm
by vinay238018
Hi,
I am Copying a Dataset into another data Set using IDCAMS Utility.

REPRO INDATASET(INPUT.FILENAME) -
OUTDATASET(OUTPUT.FILENAME)


But it is failing whenever "INPUT.FILENAME" is opened, Is there is a way to resolve this issue using INDATASET and OUTDATASET in IDCAMS.

Please help.

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 10:32 pm
by NicC
How is it failing? What are the error messages and codes. How do you expect people to help if you do not give details of what is wrong? Are those 2 lines the only SYSIN to your IDCAMS step? Might also be a good idea to post the file attributes for both input and output.

Oh, and use the code tags - available via the 'POST REPLY' button rather than the 'Quick Reply' button.

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 10:40 pm
by vinay238018
The O/P Codes is as follows:
IKJ56225I DATA SET INPUT.FILENAME ALREADY IN USE, TRY
IKJ56225I LATER
IKJ56225I DATA SET IS ALLOCATED TO ANOTHER JOB OR USER
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12

Data Set attributes are from FB 80 to FB 80.

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:03 pm
by BillyBoyo
And what is it that is unclear? "Someone else", could be you, has the dataset you are trying to copy from open, and your dataset is defined not to allow anyone else to read it whilst it is in that particular state (open for read, open for update, we don't know).

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:08 pm
by bodatrinadh
It is clearly says

"IKJ56225I DATA SET INPUT.FILENAME ALREADY IN USE, TRY
IKJ56225I LATER
IKJ56225I DATA SET IS ALLOCATED TO ANOTHER JOB OR USER"

Either you or other user/job is using your file. Try to close it and rerun the job.

Thanks
-3nadh

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:08 pm
by vinay238018
This is what i wanted to ask that ,whether we use in SHR mode with REPRO options in INDATSET to OUTDATASET Copy.
Is that possible.
Even if it is used by some Job or User, we can use that file in Share mode while doing a Copy in IDCAMS (INDATSET to OUTDATASET) options.

Please advice.

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:12 pm
by bodatrinadh
Check in SPOOL, Whether your job is showing any contention with any resourse.

Thanks
-3nadh

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:22 pm
by BillyBoyo
Is it your dataset? If not, talk to the person(s) responsible for it, explain what you want to do, and why, and follow their advice.

It is possible to define a VSAM dataset in several ways. If it is yours, look at Shareoptions as part of the DEFINE/ALTER.

Re: IDCAMS query

PostPosted: Sat Feb 18, 2012 11:53 pm
by vinay238018
Thanks every one,

this means we cannot use the file used by USER or Job in REPRO Command of IDCAMS in Share mode for INDATASET options.

Re: IDCAMS query

PostPosted: Sun Feb 19, 2012 12:56 am
by enrico-sorichetti
shareoptions is not involved here ...
when using the INDATASET/OUTDATSET clauses IDCAMS allocates with <DISP OLD>

if You have the dataset allocated and You do not have <integrity> issues then
allocate the datasets using the jcl DD statements and use the INDD/OUTDD clauses