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
 

 

List datasets in DASD

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed Jun 26, 2013 2:08 pm    Post subject: List datasets in DASD
Reply with quote

I had a requirement to get the list of all datasets in DASD with the volume, size, created date and last referenced date based on high level qualifier -> A**.BCD.**

So, I did a SAVE LIST and used SORT to get these details. Now I am expected to automate the SAVE LIST part also. I tried IGGCSIRX, but it does not get me the size details nor the date info.

Is there any way to do in JCL?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 26, 2013 2:34 pm    Post subject:
Reply with quote

DCOLLECT records may be the way to go on this one
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Jun 26, 2013 4:26 pm    Post subject:
Reply with quote

You can use the below job:
Code:
//STEP01   EXEC PGM=ADRDSSU,PARM='TYPRUN=NORUN'
//SYSPRINT DD SYSOUT=*                         
//BACKUP   DD DUMMY                           
//SYSIN    DD *                               
 DUMP DATASET(INCLUDE( A*.BCD.** )) -       
      OUTDDNAME(BACKUP)


You can parse the datasets name from the SYSPRINT using SORT.

EDIT: The above job will get you only dataset names starting with A*.BCD.*, Not the other details you are looking for. Sorry I didnt focus on your requirements completely.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Jun 26, 2013 4:29 pm    Post subject:
Reply with quote

DCOLLECT type V and D records give you what you want. After running the DCOLLECT job you'll need to process the output with a program in the language of your choice (SAS for example, although I have used COBOL on DCOLLECT ouitput as well).
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 26, 2013 4:30 pm    Post subject:
Reply with quote

Mistah Kurtz

How does this get the required information for the OP ???

Quote:
list of all datasets in DASD with the volume, size, created date and last referenced date
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Jun 26, 2013 4:31 pm    Post subject:
Reply with quote

mistah kurtz, how does your job provide created date and last referenced date for those data sets? That IS part of the requirement, after all.
Back to top
View user's profile Send private message
mistah kurtz

Active User


Joined: 28 Jan 2012
Posts: 268
Location: Room: TREE(3). Hilbert's Hotel

PostPosted: Wed Jun 26, 2013 4:34 pm    Post subject:
Reply with quote

Hi Robert and Expat..
I realized my mistake soon after posting..so I was in the process of editing my previous post.

Once again my apologies !!
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed Jun 26, 2013 7:20 pm    Post subject:
Reply with quote

Thanks for the suggestions.

I tried using DCOLLECT and had few questions.

DCOLLECT -
OUTFILE(DCOL) -
VOLUMES( -
LH* -
DEV* -
STO* -
)

the output was something like this -

& D HXA1 ±Ó " DATASET NAME ± ° STO165$è ð STO165

How would I get size, and date information from this? Do we have a record fromat?
Can I search based on dataset name (A*.BCD.**) rather than volumes?
And I need only the sequesntial files in DASD. how can I filter out PDS?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 26, 2013 7:23 pm    Post subject:
Reply with quote

Everything that you need to know about DCOLLECT is contained in the IDCAMS manual
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Wed Jun 26, 2013 7:51 pm    Post subject:
Reply with quote

As is typical with IBM utilities, the records contain binary and packed decimal data fields. There is an appendix in the IDCAMS manual that provides the layout for the various record types (you will need to use the V and D records to get volume and data set data respectively).
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jun 27, 2013 2:27 pm    Post subject:
Reply with quote

Hello,
If the number of datasets to be reported is in some 1000's or less, you could try ISMF's Naviquest to get the information. Assuming if you have access to ISMF.

Code:
//         JCLLIB ORDER=(SYS1.SACBCNTL)
//GENREP   EXEC  ACBJBAOB,PLIB1=SYS1.DGTPLIB,                       
//            TABL2=SOME.PDS.FILE.HERE.WITH.FB80                                 
//SYSTSIN  DD *                                                     
PROFILE PREFIX(YOUR USERID)                                             
ISPSTART CMD(ACBQBAI2 SAVE DSNLIST +                               
VTOCDATA(Y) HSMDATA(Y) +                                           
DSN('A**.BCD.** ')) +                         <-- YOUR DATASET MASK GOES HERE
NEWAPPL(DGT) BATSCRW(132) BATSCRD(27) BREDIMAX(3) BDISPMAX(99999999)
/*                                                                 
//GENREP2   EXEC  ACBJBAOB,PLIB1=SYS1.DGTPLIB,         
//            TABL2=SOME.PDS.FILE.HERE.WITH.FB80        <-SAME PDS THATS IN LINE 3 OF THIS JCL                   
//ISPFILE DD  DISP=OLD,DSN=SOME.PS.FILE.FOR.OUTPUT.REPORT     
//SYSTSIN  DD *                                       
PROFILE PREFIX(YOUR USERID)                               
ISPSTART CMD(ACBQBAR1 DSNLIST) +                       
BATSCRW(132) BATSCRD(27) BREDIMAX(3) BDISPMAX(99999999)
/*                                                     
//SYSIN DD  *                                         
DSN                                                   
VOLSER                                                 
ALLOCSP                                               
ALLOCUSED                                             
CREATEDT                                               
LASTREF                                               
/*   

sample output:
Code:
 DATASETNAME                VOLSER  ALLOCSP   ALLOCUS  CREATEDT   LASTREF   
----------------------------------------------------------------------------
 WELLS.SOMETHING            ABC010      830K       55K 2012/11/29 2012/11/29
 WELLS.CLIST                ABC005      719K      221K 2012/11/16 2013/06/26
 WELLS.REPORT.DONTLOOK      ABC001     4150K      111K 2013/06/07 2013/06/07
 WELLS.REXX                 ABC006     4150K      166K 2013/06/07 2013/06/07
 WELLS.ETC                  ABC011     4150K      166K 2013/06/07 2013/06/07 

For more information you could check
http://publib.boulder.ibm.com/infocenter/zos/v1r11/index.jsp?topic=/com.ibm.zos.r11.idas200/dclstexc.htm

My first job with Naviquest. :-)

Hope it helps.
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Thu Jun 27, 2013 5:10 pm    Post subject:
Reply with quote

Thanks Vasanth.

It ended in MAXCC 8 with the message 'TBOPEN OF TABLE DSNLIST FAILED BECAUSE IT DOESN'T EXIST'.

I have given a valid PDS with FB80 in TABL2. Can you please help?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jun 27, 2013 5:55 pm    Post subject:
Reply with quote

Hello,
In which step? //GENREP or //GENREP2?

If the first step is successful you should be able to see a member named DSNLIST in your SOME.PDS.FILE.HERE.WITH.FB80.
Are you able to see that member?

Post the messages inside the DD names SYSTSPRT & ISPLOG
for both the steps.
Also the dataset attributes of SOME.PDS.FILE.HERE.WITH.FB80

It will help in debugging.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Jun 27, 2013 6:14 pm    Post subject:
Reply with quote

In this line of Vasanth's code:
Code:
DSN('A**.BCD.** ')) +                         <-- YOUR DATASET MASK GOES HERE
remove the space after the ** and before the quote (tic) mark. That space causes the code to not run correctly.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Thu Jun 27, 2013 6:16 pm    Post subject:
Reply with quote

Thanks Robert,
icon_biggrin.gif Hope that was the issue and TS gets the output this time around.
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Fri Jun 28, 2013 2:32 pm    Post subject:
Reply with quote

After modifying the mask, It ended with RC 12 in GENREP with the below error -

ISPLOG :

***** ISMF ERROR ***** - APPLICATION(DGT1 - DATA SET); FUNCTION(SELECT)
- RETURN CODE(0012); REASON CODE(0079)

Does this mean I do not access to ISMF?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Jun 28, 2013 2:42 pm    Post subject:
Reply with quote

Hello,

Looks like you have access to ISMF.
- RETURN CODE(0012); REASON CODE(0079)

I think this error occurs if dataset is migrated and softwares like Ca-Disk is used, hence ISMF is unable to get migrated dataset information(I might be wrong here). I think this can be ignored and you can proceed to the second step of the job.
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Fri Jun 28, 2013 4:48 pm    Post subject:
Reply with quote

Actually the second step has also run but the report dataset is empty.

The SYSTSPRT of GENREP2 has this message -
ISPSTART CMD(ACBQBAR1 DSNLIST) BATSCRW(132) BATSCRD(27) BREDIMAX(3) BDISPMAX(99
Table being printed is: DSNLIST
Number 1 parameter was: DSN
Number 2 parameter was: VOLSER
Number 3 parameter was: ALLOCSP
Number 4 parameter was: ALLOCUSED
Number 5 parameter was: CREATEDT
Number 6 parameter was: LASTREF
TBOPEN OF TABLE DSNLIST FAILED BECAUSE IT DOESN'T EXIST

and ISPLOG -

Start of ISPF Log - - - - Session # 1 ------
TSO - Command - - ACBQBAR1 DSNLIST
End of ISPF Log - - - - - Session # 1 ------
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Fri Jun 28, 2013 6:55 pm    Post subject:
Reply with quote

It worked.. Issue was with the PDS as it did not have enough space to allocate DSNLIST..

Thank you all for the responses!! it was very helpful.. icon_smile.gif
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1445
Location: Azeroth

PostPosted: Fri Jun 28, 2013 7:05 pm    Post subject:
Reply with quote

Im glad it worked icon_biggrin.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm
No new posts reorder screeNS using SWAP LIST? mrsidhu12 TSO/ISPF 5 Thu Sep 01, 2016 2:19 pm
No new posts Getting list of tables defined under ... kishpra DB2 2 Wed Aug 24, 2016 10:36 am


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