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
 

 

DASD attributes extraction for VSAM files using Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: DASD attributes extraction for VSAM files using Rexx
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10275
Location: italy

PostPosted: Wed May 27, 2009 11:52 am    Post subject: Reply to: DASD attributes extraction for VSAM files using Re
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10275
Location: italy

PostPosted: Wed May 27, 2009 12:10 pm    Post subject: Reply to: DASD attributes extraction for VSAM files using Re
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 03, 2009 7:07 pm    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Jun 03, 2009 7:08 pm    Post subject:
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    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 Passing data from REXX to C programme... chong.zhou All Other Mainframe Topics 0 Wed Jul 26, 2017 4:55 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm
No new posts REXX WTO for console message bipinpeter CLIST & REXX 6 Tue Jun 27, 2017 3:56 pm


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