Page 1 of 1

How to know thee disp of a dataset

PostPosted: Thu Mar 29, 2012 8:33 pm
by samb01
Hello,

i have a REXX in a job :

//IKJ      EXEC PGM=IKJEFT1A                 
//SYSTSIN  DD  *                                                       
PROFILE NOPREFIX                                                       
ISPSTART CMD(%SDAR)                                                 
//SYSPROC  DD DSN=REXX.V12.ISPCLIB,DISP=SHR                 
//SYSEXEC  DD  DISP=SHR,DSN=&REXXLB                                   
//SYSTSPRT DD  SYSOUT=*                                               
//ISPLOG   DD  DUMMY                                                   
//ISPPROF  DD  DSN=&&PROF,DISP=(NEW,PASS),                             
//     DCB=(LRECL=80,BLKSIZE=6160,RECFM=FB),                           
//     SPACE=(TRK,(2,1,2)),UNIT=VIO                                   
//ISPMLIB  DD  DSN=REXX.V12.SISPMENU,DISP=SHR                 
//ISPSLIB  DD  DSN=REXX.V12.SISPSENU,DISP=SHR                 
//ISPPLIB  DD  DSN=REXX.V12.SISPPENU,DISP=SHR                 
//ISPTLIB  DD  DSN=REXX.V12.SISPTENU,DISP=SHR                 
//SYSTSPRT DD  SYSOUT=*                                               
//SYSTERM  DD  SYSOUT=*                                               
//SYSABEND DD  SYSOUT=*                                               
//ISPLOG DD SYSOUT=*,                                               
// LRECL=120,BLKSIZE=2400,DSORG=PS,RECFM=FB                         
//*                                                                 
//IN  DD DISP=SHR,DSN=FIC.TEST


and i would like to know the disp of the dataset with the ddname IN.

Actually, i successed to get the name of the dataset with this command

WA = LISTDSI('FICIN FILE') 
FICA = SYSDSNAME


How can i do to know the DISP of the dataset in my REXX ?

Because the disp could be MOD or SHR etc...

Thank's for your Help.

Re: How to know thee disp of a dataset

PostPosted: Thu Mar 29, 2012 8:48 pm
by Akatsukami
By looking at the ALLOC command that allocates the data set to IN.

Re: How to know thee disp of a dataset

PostPosted: Thu Mar 29, 2012 9:02 pm
by BillyBoyo
Off-topic, but the subject is almost poetic: "How to know thee, disp of a dataset? Through thine eyes? Mine heart? Be thee NEW, MOD, OLD or e'en PASS, I seek to know thy DISP."

But most if it was chopped off 'cos the box is too short :-)

Re: How to know thee disp of a dataset

PostPosted: Thu Mar 29, 2012 9:14 pm
by Akatsukami
Ars longa, box brevis? :D

Re: How to know thee disp of a dataset

PostPosted: Fri Mar 30, 2012 11:45 am
by steve-myers
There are a couple of issues here:
  • You are asking about data set status, (e.g., OLD, NEW, MOD, SHR), not disposition (e.g., KEEP, CATLG, DELETE, PASS).
  • It is possible to effectively change dataset status from shared to exclusive, and I wouldn't bet the controls that record the initial status from the DD statement or the ALLOCATE command are updated when this happens, since there is no requirement to record this change in every instance of the allocation; it is not possible to "downgrade" from exclusive to shared, though, of course once all instances of the dataset allocation are freed the status disappears. In other words, any report may be incorrect.
You can obtain the disposition by output "trapping" the output from the TSO LISTALC HISTORY STATUS command, but this output does not show status. I think LISTALC did show status at one time, but it has been removed since its reliability is questionable as I discussed in the second bullet.

Re: How to know thee disp of a dataset

PostPosted: Fri Mar 30, 2012 2:11 pm
by samb01
Finally, i use an argument in my REXX to know the disp

//IKJ      EXEC PGM=IKJEFT1A,DYNAMNBR=100,REGION=4M   
//SYSTSIN  DD  *                                     
PROFILE NOPREFIX                                     
ISPSTART CMD(%SDAR MOD)                             




and i get it by this way

ARG DISP 

"ALLOC F(FICB) DA("FICB") "DISP""   
"EXECIO * DISKW FICB(FINIS"         
"FREE F(FICA FICB)"                 
 


Re: How to know thee disp of a dataset

PostPosted: Thu Apr 05, 2012 5:13 am
by Pedro
Just to be complete:

Someone skilled in assembler, should be able to write an assembler program that issues SVC 99 to retrieve allocation information. Use verb code 07 with text units DINDDNAM and DINRTSTA.

See "MVS Programming: Authorized Assembler Services Guide", SA22-7608

Re: How to know thee disp of a dataset

PostPosted: Thu Apr 05, 2012 6:34 am
by steve-myers
Pedro wrote:Just to be complete:

Someone skilled in assembler, should be able to write an assembler program that issues SVC 99 to retrieve allocation information. Use verb code 07 with text units DINDDNAM and DINRTSTA.

See "MVS Programming: Authorized Assembler Services Guide", SA22-7608

That is one way to do it. Another way is to perform a RDJFCB and examine select JFCB data areas. Neither my solution or Pedro's solution require huge Assembler Language skills.

Note, too, that the examples from the topic starter are setting status, not retrieving status to display it, which is what 'knowing" status implies.