View previous topic :: View next topic
|
Author |
Message |
David_Li
New User
Joined: 05 Apr 2006 Posts: 10
|
|
|
|
1. More than 1000 records in a dataset (PS), each record is VSAM file name. like this:
*******************************************************
SERS.MSI.FTRSF.TEST1
SERS.MSI.FTRSF.TEST2
SERS.MSI.FTRSF.TEST3
SERS.MSI.FTRSF.TEST4
SERS.MSI.FTRSF.TEST5
SERS.MSI.FTRSF.TEST6
........ .......
SERS.MSI.FTRSF.T1000
*******************************************************
2. I want to know whether these files exist in system. And print the files name which are not in system in dataset 'SERS.MSI.OUTPUT'.
How do i do?
High appreciate with any response. |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Using IDCAMS, you could take every dataset name and format LISTCAT control cards to see if a dataset exists:
Code: |
//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENTRY(HLQ.DATASET.NAME.FILE1)
LISTCAT ENTRY(HLQ.DATASET.NAME.FILE2)
/*
|
If it exists, the output would look like:
Code: |
LISTCAT ENTRY(HLQ.DATASET.NAME.FILE1) NAME
NONVSAM ------- HLQ.DATASET.NAME.FILE1
|
If it does not exist, the output would look like:
Code: |
LISTCAT ENTRY(HLQ.DATASET.NAME.FILE2)
IDC3012I ENTRY HLQ.DATASET.NAME.FILE2 NOT FOUND
|
You could write the SYSPRINT output from the IDCAMS step to a permanent dataset, so it could be later edited to identify the "NOT FOUND" files. |
|
Back to top |
|
|
crrindia
Active User
Joined: 02 Jul 2005 Posts: 124 Location: Gurgaon
|
|
|
|
Hi, Here you are providing the Syntax to check individual one by using the LISTCAT parameter. But as per David's note Suppose if we want to check only that PS file(all of the VSAM files exists in that file), and from there it should check all of those VSAM files. For that how to verify it? Please provide sample Syntax also.
Thanks!
Rathna. |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
My suggestion was to take the complete list of datasets, format a LISTCAT command using each dataset, and finally run an IDCAMS and write the SYSPRINT results to a dataset.
If you are looking for a single LISTCAT command for listing all datasets that match a specific pattern, you could use:
Code: |
LISTCAT LEVEL('SERS.MSI')
|
This command will not list missing datasets, only existing ones. If you took the list of existing datasets and placed them sequentially in a dataset starting in position 1. Then take the list of datasets from your original dataset and place them sequentially in a dataset starting in position one.
You could then sort them all together using ICETOOL or SYNCTOOL using the NODUPS option and the output file would be every dataset that didn't match the datasets on your original file. |
|
Back to top |
|
|
David_Li
New User
Joined: 05 Apr 2006 Posts: 10
|
|
|
|
Thanks, Guys.
Yeah, That is a way to figure out the question with single dataset or a group datasets which have the same High qualify.
I found another way. use REXX. This way also can verify that. Share with you.
Code: |
/*REXX*/
DSNAME = 'SERS.BSP.ERSCICI2.CSD(ERSI2CSD)'
"ALLOC FI(MYINDD1) DA('"DSNAME"') SHR REUSE"
"EXECIO * DISKR MYINDD1 (STEM NEWVAR. FINIS"
"FREE FI(MYINDD1)"
DO I1 = 1 TO NEWVAR.0
IF INDEX(NEWVAR.I1,"DEFINE FILE(") > 0 THEN
DO
POS2 = INDEX(NEWVAR.I1,")")
FILE_LENG = POS2 - 13
FILENAME = SUBSTR(NEWVAR.I1,13,FILE_LENG)
I1 = I1 + 1
IF INDEX(NEWVAR.I1,"DSNAME(") > 0 THEN
DO
POS2 = INDEX(NEWVAR.I1,")")
FILE_LENG = POS2 - 15
PHYFILE = SUBSTR(NEWVAR.I1,15,FILE_LENG)
/* SAY LEFT(FILENAME,12) PHYFILE */
XX = SYSDSN("'"PHYFILE"'")
IF XX \= 'OK' THEN
DO
SAY LEFT(FILENAME,12) PHYFILE
END
END
END
END
EXIT |
Original file: 'SERS.BSP.ERSCICI2.CSD(ERSI2CSD)
************************************************************
..... ......... ............. .............
DEFINE FILE(file name1)
..... ......... ............. .............
DEFINE FILE(file name2)
DEFINE FILE(file name3)
.............................
DEFINE FILE(file name4)
DEFINE FILE(file nameN)
************************************************************ |
|
Back to top |
|
|
|