Page 2 of 2

Re: IDCAMS query

PostPosted: Sun Feb 19, 2012 2:08 am
by vinay238018
Thanks , This explains somewhat. then can we override the Allocations using some override, or Parm to IDCAMS?

Re: IDCAMS query

PostPosted: Sun Feb 19, 2012 2:39 am
by enrico-sorichetti
then can we override the Allocations using some override, or Parm to IDCAMS?

can You read ?
my reply was clear enough!

Re: IDCAMS query

PostPosted: Sun Feb 19, 2012 7:37 am
by steve-myers
Actually, Enrico used an incorrect IDCAMS keyword. When you use the INDATASET and OUTDATASET keywords, IDCAMS allocates the datasets with exclusive control. By using the INFILE(ddname) or OUTFILE(ddname) keywords you can specify DISP=SHR, which allows the command to run provided the job or TSO user that has the dataset allocated with shared access, like this
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//INPUT    DD  DISP=SHR,DSN=input.dataset
//SYSIN    DD  *
  REPRO INFILE(INPUT) -
       OUTDATASET(output.dataset)

Re: IDCAMS query

PostPosted: Sun Feb 19, 2012 2:00 pm
by enrico-sorichetti
:oops:

Re: IDCAMS query

PostPosted: Mon Feb 20, 2012 11:23 am
by steve-myers
It occurred to me the wording of my last post on this topic was poor, so I'll try again.

When you use the INDATASET and OUTDATASET keywords, IDCAMS allocates the datasets with exclusive control. By using the INFILE(ddname) or OUTFILE(ddname) keywords you can specify DISP=SHR in the JCL, which allows the command to run provided the other job or TSO user using the dataset has the dataset allocated with shared access. Your job would look like this -
//STEP01  EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//INPUT    DD  DISP=SHR,DSN=input.dataset
//SYSIN    DD  *
  REPRO INFILE(INPUT) -
       OUTDATASET(output.dataset)
If the other job or TSO user has input.dataset allocated with exclusive control, your job will not run until the other job or TSO user releases the dataset or the job ends or the TSO user logs off.

Re: IDCAMS query

PostPosted: Tue Feb 21, 2012 12:18 pm
by vinay238018
Thanks a lot, it worked.