View previous topic :: View next topic
|
Author |
Message |
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Does somebody know how can I retrieve informations, using command LISTDSI( or other way), about the sysdsnames of concatenated input files?
All comments and advise are welcome. |
|
Back to top |
|
|
ankyhunk
Moderator
Joined: 05 May 2005 Posts: 98 Location: Navi Mumbai, India
|
|
|
|
Hi,
you can use - X = LISTDSI("'"INDD"'")
where INDD is input dataset and then display info like
IF X = 0 THEN
DO
SAY 'SYSDSORG' SYSDSORG
SAY 'SYSLRECL' SYSLRECL
END
Hope it helps... |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Ok, this is the simple solution but work for a unique dataset!
In my case, I have five concatenated dataset in INPUT( or INDD) statement then I need to retrieve exactly five distinct information. |
|
Back to top |
|
|
ankyhunk
Moderator
Joined: 05 May 2005 Posts: 98 Location: Navi Mumbai, India
|
|
|
|
can u elaborate on your problem as to what info about concatenated datasets are you looking for & why do ya need it? Also each of the datasets might have different info ! |
|
Back to top |
|
|
jaison.baby
New User
Joined: 06 May 2005 Posts: 2 Location: Kerala
|
|
|
|
Hi MGIndaco,
I am assuming that ur requirement is that u have a job in which there are lots of DD DSN statements. You have to get the information in all those datasets which are given against your DD DSN statements.
One solution(i dont know whether that is the best method) is to write a rexx which will accept as input your source JOB file. This exec will scan your source code for DSN statements and extract all the DSN names. Then you can loop the logic given by ankyhunk to all the dataset names.
thanks
Jaison |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
I've exceed my problem passing my list of files within my input dd and reading their from time to time overriding now even my problem of not existing dataset. |
|
Back to top |
|
|
MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Find all the dd of your step allowing so to view concat or temporary dataset or instream:
Code: |
Call Listdd
Do i = 1 To MyList.0
Say MyList.i
End
Exit
Listdd: Procedure Expose MyList.
Numeric digits 10
Drop ddname. dsname.
tiotptr=24+ptr(12+ptr(ptr(ptr(16))))
tioelngh=c2d(stg(tiotptr,1))
a=0
ddname=' '
Do Until tioelngh=0
tioeddnm=strip(stg(tiotptr+4,8))
If substr(tioeddnm,1,1) <>'00'x Then
Do
If substr(tioeddnm,1,1) <>" " Then
ddname=tioeddnm
If ddname=Arg(1) Then
Say
Do
a=a+1
ddname.a=ddname
tioelngh=c2d(stg(tiotptr,1))
tioejfcb=stg(tiotptr+12,3)
jfcb=swareq(tioejfcb) /* Convert sva in 31-Bit addr*/
dsname.a=strip(stg(jfcb,44)) /* Dsname jfcbdsnm */
MyList.a = Left(ddname.a,8,' ') '=' dsname.a
MyList.0 = a
End
End
tiotptr=tiotptr+tioelngh /* Next entry */
tioelngh=c2d(stg(tiotptr,1)) /* Length next entry */
End
Return
/* pointer*/
ptr: Return c2d(storage(d2x(Arg(1)),4))
/* storage*/
stg: Return storage(d2x(Arg(1)),Arg(2))
/* jfcb */
swareq: Procedure
If right(c2x(Arg(1)),1) ?= 'F' Then /* SWA=BELOW ? */
Return c2d(Arg(1))+16 /* YES, RETURN SVA+16 */
sva = c2d(Arg(1)) /* CONVERT TO DECIMAL */
tcb = ptr(540) /* TCB PSATOLD */
jscb = ptr(tcb+180) /* JSCB TCBJSCB */
qmpl = ptr(jscb+244) /* QMPL JSCBQMPI */
qmat = ptr(qmpl+24) /* QMAT QMADD */
Do While sva>65536
qmat = ptr(qmat+12) /* NEXT QMAT QMAT+12 */
sva=sva-65536 /* 010006F -> 000006F */
End
Return ptr(qmat+sva+1)+16
|
|
|
Back to top |
|
|
Mike Porritt
New User
Joined: 10 Nov 2007 Posts: 1 Location: Australia
|
|
|
|
Gday,
A simple way to do this in batch or online is to use the TSO LISTA command to get the concatenated datasets names on a DD/FILE and then if you need more info use LISTDSI on each dataset.
This works for normal concatenated datasets and even concatenated GDG datasets or just the GDG base - which will reveal all generations as a base reference effectively concatenates all generations.
A sample JCL and the REXX code it call is included below:
//LISTEMT JOB TS-1084-N,'D',MSGLEVEL=(1,1),MSGCLASS=X,CLASS=P,
// NOTIFY=P653593
//*------------------------------------------------------------
//* RUN LISTEM
//*------------------------------------------------------------
//STEP01 EXEC PGM=IKJEFT01,PARM='LISTEM TESTFILE'
//TESTFILE DD DISP=SHR,DSN=P653593.ISPCLIB
// DD DISP=SHR,DSN=P653593.JCL.CNTL
// DD DISP=SHR,DSN=P653593.TSYS.CNTL
//SYSTSIN DD DUMMY
//SYSTSPRT DD SYSOUT=*
//SYSEXEC DD DISP=SHR,DSN=P653593.ISPCLIB
==========================================
==========================================
/* Tyrannosaurus REXX */
Arg DDIN
SetTrap = OUTTRAP(LINE.)
LISTA status
SetTrap = OUTTRAP(OFF)
/* PARSE LISTA OUTPUT */
Do j = 1 to line.0
if strip(substr(line.j,3,8)) = DDIN then leave
End ;
If j = line.0 then say not found
else
Do ;
j = j - 1;
ThisDSN = line.j; Call Process_ThisDSN ;
Do k = (j+2) to line.0 by 2
l = k + 1;
If Substr(line.l,3,1) <> ' ' then
k = line.0 ;
Else
Do ;
ThisDSN = line.k;
Call Process_ThisDSN ;
End ;
end ;
return;
Process_ThisDSN:
ThisDSN = "'"strip(ThisDSN)"'"
x = LISTDSI(ThisDSN DIRECTORY)
Say ThisDSN ' has ' SYSMEMBERS ' members.'
return; |
|
Back to top |
|
|
|