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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Ghellar

New User


Joined: 01 Sep 2005
Posts: 12

PostPosted: Mon Jul 18, 2011 12:34 pm    Post subject: Find the date of creation with LISTC ENT (gdg) ALL
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

Senior Member


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

PostPosted: Mon Jul 18, 2011 7:32 pm    Post subject: Reply to: Find the date of creation with LISTC ENT (gdg) ALL
Reply with quote

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

Moderator Team Head


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

PostPosted: Mon Jul 18, 2011 8:27 pm    Post subject: Reply to: Find the date of creation with LISTC ENT (gdg) ALL
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jul 18, 2011 9:07 pm    Post subject:
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: 1712
Location: UK

PostPosted: Tue Jul 19, 2011 1:02 am    Post subject:
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

Senior Member


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

PostPosted: Tue Jul 19, 2011 1:37 am    Post subject: Reply to: Find the date of creation with LISTC ENT (gdg) ALL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 19, 2011 2:11 am    Post subject: Re: Find the date of creation with LISTC ENT (gdg) ALL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 19, 2011 4:36 am    Post subject: Reply to: Find the date of creation with LISTC ENT (gdg) ALL
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: 12

PostPosted: Tue Jul 19, 2011 12:36 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Jul 19, 2011 12:41 pm    Post subject: Reply to: Find the date of creation with LISTC ENT (gdg) ALL
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
http://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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Jul 19, 2011 12:46 pm    Post subject:
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: 12

PostPosted: Tue Jul 19, 2011 12:52 pm    Post subject:
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    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 How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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