Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

LISTDSI in concatenated files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Apr 29, 2005 6:46 pm    Post subject: LISTDSI in concatenated files
Reply with quote

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
View user's profile Send private message

ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Thu May 05, 2005 5:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu May 05, 2005 6:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Thu May 05, 2005 7:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
jaison.baby

New User


Joined: 06 May 2005
Posts: 2
Location: Kerala

PostPosted: Fri May 06, 2005 2:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon May 09, 2005 7:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Sun Jan 15, 2006 12:05 am    Post subject:
Reply with quote

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
View user's profile Send private message
Mike Porritt

New User


Joined: 10 Nov 2007
Posts: 1
Location: Australia

PostPosted: Mon Nov 12, 2007 1:33 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us