How to know thee disp of a dataset



IBM's Command List programming language & Restructured Extended Executor

How to know thee disp of a dataset

Postby samb01 » Thu Mar 29, 2012 8:33 pm

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.
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to know thee disp of a dataset

Postby Akatsukami » Thu Mar 29, 2012 8:48 pm

By looking at the ALLOC command that allocates the data set to IN.
"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: How to know thee disp of a dataset

Postby BillyBoyo » Thu Mar 29, 2012 9:02 pm

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 :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to know thee disp of a dataset

Postby Akatsukami » Thu Mar 29, 2012 9:14 pm

Ars longa, box brevis? :D
"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: How to know thee disp of a dataset

Postby steve-myers » Fri Mar 30, 2012 11:45 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: How to know thee disp of a dataset

Postby samb01 » Fri Mar 30, 2012 2:11 pm

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)"                 
 

samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: How to know thee disp of a dataset

Postby Pedro » Thu Apr 05, 2012 5:13 am

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
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: How to know thee disp of a dataset

Postby steve-myers » Thu Apr 05, 2012 6:34 am

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.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post