IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DASD attributes extraction for VSAM files using Rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bandita Bahubalendra

New User


Joined: 08 May 2008
Posts: 15
Location: Bangalore

PostPosted: Wed May 27, 2009 11:48 am
Reply with quote

Hi All,

I have some of the VSAM files listed in a dataset as records.

I would want to read them one by one and pull only the allocation details (space-units, space-allocated, space-used) of each of the VSAM dataset and
finally place them onto a dataset. The final dataset/output should like something like this –

VSAM Dataset Space-Units Space-Allocated(Hi-A-RBA) Space-Used(HI-U-RBA)
ABC.ositx58.E.C Cylinder 94371840 94371839
DCB.ositx58.E.C Cylinder 94371850 94371840


Right now I am using a Rexx exec which takes IDCAMS command called LISTCAT to list the attributes of a single file. The code I used is –

/*REXX*/
X = OUTTRAP("LST.")
ADDRESS TSO "LISTCAT ALL ENTRIES('<your vsam file>')"
X = OUTTRAP("OFF")
DO I = 1 TO LST.0
SAY LST.I

Does anyone have an idea on how to pull the DASD attributes of all the VSAM files by reading one by one VSAM files?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 27, 2009 11:52 am
Reply with quote

Quote:
Does anyone have an idea on how to pull the DASD attributes of all the VSAM files by reading one by one VSAM files?


the question is a bit confusing ??
be a bit more clear, please!
Back to top
View user's profile Send private message
Bandita Bahubalendra

New User


Joined: 08 May 2008
Posts: 15
Location: Bangalore

PostPosted: Wed May 27, 2009 12:00 pm
Reply with quote

1. i have 2 Vsam file names listed as records in a dataset called abc.vsam.datasets

2. I want to read abc.vsam.datasets record by record.

3. For each record(each record is basically the Vsam file name) pull the DASD attributes i.e space units , space-allocated, space-used.

4. Place the output(extracted DASD attributes from step 3) of each record onto a single consolidated dataset abc.vsam.out

5. All the above should be done in Rexx.

Hope it is clear now
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed May 27, 2009 12:10 pm
Reply with quote

no need to be condescending, You question was badly posed
the wording might have been clear for You, but not for people trying to help You

if You had simply asked how to process a list of datasets everything would have been more clear

the issue has been debated soo manytimes that has become boring icon_cool.gif

search the forums for IGGCSIRX
Back to top
View user's profile Send private message
salehi

New User


Joined: 30 Sep 2006
Posts: 14
Location: Iran

PostPosted: Wed Jun 03, 2009 6:52 pm
Reply with quote

Hi,
You can simple read the input dataset records to a variable and use a smple Loop to extract the information for the datasets, finally display or write them to a output qsam file,
here i provide a sample,it may be useful.


//********************************************************
/*REXX*/
"ALLOC FI(INDD) DA('YOUR_INPUT_DS') SHR REUSE"
"EXECIO * DISKR INDD (STEM LINE. FINIS"
CALL EXTRACT_DSN_INFO
CALL WRITE_OUTPUT_TO_JCL
RETURN
/*************************************************************/

EXTRACT_DSN_INFO:
/* THIS FUNCTION WOULD EXTRACT THE NECCESSARY INFORMATION FROM */
/* OUTPUT OF LISTCAT COMMAND AND SAVE THEM IN NECCESARY ARRAYS */
/* DSN CAT OWNER VOLSER */
DO I=1 TO LINE.0
SELECT
WHEN SUBSTR(LINE.I, 2, 08) = 'NONVSAM' THEN
DO
IDX=IDX+1
DSN.IDX = STRIP(SUBSTR(LINE.I, 18, 40))
END
WHEN SUBSTR(LINE.I, 2, 11) = ' IN-CAT' THEN
DO
CAT.IDX = STRIP(SUBSTR(LINE.I, 17, 40))
END
/** WHEN SUBSTR(LINE.I, 31, 25) = 'LISTING FROM CATALOG -- ' THEN
DO
CAT = STRIP(SUBSTR(SORTDSN.I, 55, 45))
END **/
WHEN SUBSTR(LINE.I, 2, 20) = ' DATASET-OWNER' THEN
DO
OWNER.IDX = STRIP(SUBSTR(LINE.I, 27,8))
CRE.IDX = STRIP(SUBSTR(LINE.I, 54, 10))
END
WHEN SUBSTR(LINE.I, 2, 14) = ' RELEASE' THEN
DO
p F3=Exit F5=Rfind F6=Rchange F12=Cancel
EXTRACT_DSN_INFO:
/* THIS FUNCTION WOULD EXTRACT THE NECCESSARY INFORMATION FROM */
/* OUTPUT OF LISTCAT COMMAND AND SAVE THEM IN NECCESARY ARRAYS */
/* DSN CAT OWNER VOLSER */
DO I=1 TO LINE.0
SELECT
WHEN SUBSTR(LINE.I, 2, 08) = 'NONVSAM' THEN
DO
IDX=IDX+1
DSN.IDX = STRIP(SUBSTR(LINE.I, 18, 40))
END
WHEN SUBSTR(LINE.I, 2, 11) = ' IN-CAT' THEN
DO
CAT.IDX = STRIP(SUBSTR(LINE.I, 17, 40))
END
/** WHEN SUBSTR(LINE.I, 31, 25) = 'LISTING FROM CATALOG -- ' THEN
DO
CAT = STRIP(SUBSTR(SORTDSN.I, 55, 45))
END **/
WHEN SUBSTR(LINE.I, 2, 20) = ' DATASET-OWNER' THEN
DO
OWNER.IDX = STRIP(SUBSTR(LINE.I, 27,8))
CRE.IDX = STRIP(SUBSTR(LINE.I, 54, 10))
END
WHEN SUBSTR(LINE.I, 2, 14) = ' RELEASE' THEN
DO
/* NOT NEEDED*/
END
WHEN SUBSTR(LINE.I, 3,12) = ' VOLSER' THEN
DO
VOLSER.IDX=STRIP(SUBSTR(LINE.I, 27,9))
END
OTHERWISE
DO
/* SAY LINE.I */
END
END /* OF SELECT */
END /* DO */
RETURN
/*************************************************************/
WRITE_OUTPUT_TO_JCL:
DO I=1 TO IDX
/*SAY DSN.I ||" "||CAT.I||" "||OWNER.I||" "||VOLSER.I*/
TMP.I=DSN.I ||COPIES(' ', 45-LENGTH(DSN.I))||" " ||VOLSER.I ||,
COPIES(' ', 10-LENGTH(VOLSER.I))||" "||CRE.I
END
/*"EXECIO * DISKW OUTDD (STEM TMP. FINIS"*/
SAY "OUTPUT SUCCESSFULLY WRITEN TO TEMP DD IN JCL ..."
RETURN
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 03, 2009 7:07 pm
Reply with quote

You could always look at DCOLLECT A & D records. They will contain all of the required information.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jun 03, 2009 7:08 pm
Reply with quote

salehi,

please use BBcode/html tags to post your code.

use the code type html tags, which will maintain the spacing - indenting, which will make the nested do-loops easier to follow.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top