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

Find the date of creation with LISTC ENT (gdg) ALL


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

New User


Joined: 01 Sep 2005
Posts: 22

PostPosted: Mon Jul 18, 2011 12:34 pm
Reply with quote

Good morning everyone,

I have a problem I can not extrapolate GDG of some files, I would find the last level and date of creation, the last level I can find it, but the creation data can not, please indicate where I wrong?
If the REXX launch date of creation is always EXTENDED:


Code:
GDG = E16.S04.CRIFFER.A03300RA.GDG           
DSN = E16.S04.CRIFFER.A03300RA.GDG.G0002V00   
CREATION =        EXTENDED   





Code:
/* REXX */

GDG=E16.S04.CRIFFER.A03300RA.GDG                                   
   X = OUTTRAP(LST.)                        /* LISTCAT GDG BASE   */
     " LISTC ENT('"GDG"') ALL"                                     
   X = OUTTRAP(OFF)                                                 
SAY 'LST.0 IS =' LST.0                                             
                                            /* FIRST FIND = 0 GDG */
DO I = LST.0 TO 1 BY -1                                             
   IF POS('NONVSAM',LST.I,1) > 0 THEN                               
      DO                                                           
      DSN = SUBSTR(LST.I,POS('NONVSAM',LST.I)+13,44)               
        SAY 'LST.I=' LST.I                                         
        I = 0                                                       
      END                                                           
END                                                                 
                                                                   
DO Z = LST.0 TO 1 BY -1                                             
   IF POS('CREATION',LST.Z,1) ^= ' ' THEN                           
      DO                                                           
      DTCREAZ = SUBSTR(LST.Z,POS('CREATION',LST.Z)+1,100)       
          SAY 'LST.Z=' LST.Z                                   
            Z = 0                                               
      END                                                       
END                                                             
                                                               
SAY "----------------------------------------------"           
SAY "GDG =" GDG                                                 
SAY "DSN =" DSN                                                 
SAY "CREATION =" DTCREAZ                                       
                                                               
 ADDRESS ISPEXEC                                               
DSNLEV = 'STS58.SUN.LISTC'                                     
"LMDINIT LISTID("LSTID") LEVEL("DSNLEV")"                       
"LMDLIST LISTID("LSTID") OPTION(LIST) DATASET(DSVAR) STATS(YES)"
"LMDFREE LISTID("LSTID")"                                       


Many thanks.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Mon Jul 18, 2011 7:32 pm
Reply with quote

Show us the trace.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jul 18, 2011 8:27 pm
Reply with quote

Also, presumably these are disk datasets. I'm pretty sure it's been discussed many times here that you can't get this information for tape datasets.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jul 18, 2011 9:07 pm
Reply with quote

Can't recall exactly, but I do believe that using CSI you should get the data.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Tue Jul 19, 2011 1:02 am
Reply with quote

When I do a
Quote:
listc ent(dsn) all
I get a creation date - these are gdgs on dasd but that may be irrelevant as I presume LISTC is looking at the catalog and not the datasets.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Tue Jul 19, 2011 1:37 am
Reply with quote

Can you post the output of the LISTC command? (I never use GDGs !)
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 2:11 am
Reply with quote

Ghellar wrote:
[...]

Code:
[...]                                                                   
DO Z = LST.0 TO 1 BY -1                                             
   IF POS('CREATION',LST.Z,1) ^= ' ' THEN                           
      DO                                                           
      DTCREAZ = SUBSTR(LST.Z,POS('CREATION',LST.Z)+1,100)       
          SAY 'LST.Z=' LST.Z                                   
            Z = 0                                               
      END                                                       
END                                                             
                                                               
[...]

[...]


What are you trying to do by checking result of POS for that value?

Is Z=0 to get you out of the loop? Ugly, and I don't know what it would do. What's wrong with "leave Z"?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 4:36 am
Reply with quote

Pedro wrote:
Show us the trace.


Ghellar, you'd have had your answer at 2:03pm if you'd done this. Or did you already find it and not "fess up" so we continued wasting time on it?

When you looked at your results, dindn't you wonder where "EXTENDED" came from? Didn't you listcat the dataset and try to find "EXTENDED". And notice that the leading spaces (unlike your other two outputs, which don't have them) match up with the number of spaces on your output?

Your code would benefit from more work. Error checking. Correct premature exit from the loops (you've been here six years, I can't believe you are messing with loop counters inside the loop). Neater method for the multiple POS's. Etc. Quite a lot more work.

If you ask a question here, provide answers when people request more information. If you spot the problem yourself, tell us, so we can stop looking. If you think that the error made you look a fool, so you didn't want to, and you'd avoid that - think again.

With rexx, use trace. You'd not even have bothered asking us, you'd know.

Enough.

Just for fun, search the DFSORT forum and find an example that might allow you to junk yours.
Back to top
View user's profile Send private message
Ghellar

New User


Joined: 01 Sep 2005
Posts: 22

PostPosted: Tue Jul 19, 2011 12:36 pm
Reply with quote

Good morning everyone and thank you for your answers, sorry but I am out of office work these days and I can connect for a short time.
Excuse me if I'm no expert of REXX is the first time in a long time that I write for a problem, I can usually resolve on its own.
The files are on disk, or migrated to tape, you can not call them back to disk, because I have a lot of files to analyze.


As you can see in row No. 4 is the date: CREATION -------- 2005,095
But I can not capture it.

Result of the command LISTC ENT(E16.S04.CRIFFER.A03300RA.GDG) ALL:
Code:
GDG BASE ------ E16.S04.CRIFFER.A03300RA.GDG
     IN-CAT --- ICFCAT.VSYS02               
     HISTORY                               
       DATASET-OWNER--------E16     CREATION--------2005.095
       RELEASE----------------2     LAST ALTER------2005.116
     ATTRIBUTES                                             
       LIMIT-----------------23     SCRATCH          NOEMPTY
     ASSOCIATIONS                                           
       NONVSAM--E16.S04.CRIFFER.A03300RA.GDG.G0001V00       
       NONVSAM--E16.S04.CRIFFER.A03300RA.GDG.G0002V00       
   NONVSAM ---- E16.S04.CRIFFER.A03300RA.GDG.G0001V00       
     IN-CAT --- ICFCAT.VSYS02                               
     HISTORY                                               
       DATASET-OWNER-----(NULL)     CREATION--------2005.095
       RELEASE----------------2     EXPIRATION------0000.000
       ACCOUNT-INFO-----------------------------------(NULL)
       STATUS------------ACTIVE                             
     SMSDATA                                               
       STORAGECLASS ---STCDSAPP     MANAGEMENTCLASS----MCGDG
       DATACLASS ---------DCGDG     LBACKUP ---XXXX.XXX.XXXX
     VOLUMES                                               
       VOLSER------------MIGRAT     DEVTYPE------X'78048081'     FSEQN------------------0
     ASSOCIATIONS                           
       GDG------E16.S04.CRIFFER.A03300RA.GDG
     ATTRIBUTES                             
   NONVSAM ---- E16.S04.CRIFFER.A03300RA.GDG.G0002V00       
     IN-CAT --- ICFCAT.VSYS02                               
     HISTORY                                               
       DATASET-OWNER-----(NULL)     CREATION--------2005.116
       RELEASE----------------2     EXPIRATION------0000.000
       ACCOUNT-INFO-----------------------------------(NULL)
       STATUS------------ACTIVE                             
     SMSDATA                                               
       STORAGECLASS ---STCDSAPP     MANAGEMENTCLASS----MCGDG
       DATACLASS ---------DCGDG     LBACKUP ---0000.000.0000
     VOLUMES                                               
       VOLSER------------ESQD11     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ983     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ149     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ478     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ479     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ707     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ972     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
       VOLSER------------ESQ749     DEVTYPE------X'3010200F'     FSEQN-----------------0                                                                     
     ASSOCIATIONS                                                             
       GDG------E16.S04.CRIFFER.A03300RA.GDG                                   
     ATTRIBUTES                                                               
       STRIPE-COUNT-----------8                                               
       EXTENDED



Include the file TXT with TRACE I

Excuse me again if I did not give all the specifics, and I have wasted your time.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Jul 19, 2011 12:41 pm
Reply with quote

the result of the POS builtin should be checked against 0 ( numerical value ) not a blank

here is a link to the TSO manuals
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK90
not the latest ones, but more than enough for Your needs
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 19, 2011 12:46 pm
Reply with quote

Ghellar wrote:
[...]
EXTENDED[/code]
[...]


Here is the "date" you are extracting.

Did you read my posts? If I was too rude, try enrico's.

You have a test on the result of POS which will always be true. Therefore, the first line that you give it will always give a match, whether or not your search string exists in that line. So, since the first line you give it is the last line, it will always use the last line. Since your search string does not exist, the result of the POS will be zero, and that is where you will take your date from. Since you have conveniently allowed for 100 characters for the date, you pick up the word "EXTENDED" as well.
Back to top
View user's profile Send private message
Ghellar

New User


Joined: 01 Sep 2005
Posts: 22

PostPosted: Tue Jul 19, 2011 12:52 pm
Reply with quote

Thanks I will look the manuals, many thanks Enrico.
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 Date format correction using dfsort DFSORT/ICETOOL 3
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts CONVERT a given date from UTC TO BST CICS 0
No new posts Pull data using date difference betwe... DB2 6
No new posts CA7 count with DATE variable CA Products 0
Search our Forums:

Back to Top