Is there an IEB utility or some trick in JCL to examine. . .

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
User avatar
seagreg
Member
Posts: 4
Joined: Thu Jan 25, 2007 11:23 pm
Location: USA

Is there an IEB utility or some trick in JCL to examine. . .

Post by seagreg » Fri Jan 26, 2007 1:14 am

the Create-Date of a GDG file?

I have routines that create MONTHLY files based on actually reading the file contents by using the sort/copy & include statements to filter by date, ex:

SORT FIELDS=COPY
INCLUDE COND=(73,3,CH,EQ,C'DEC',76,4,CH,EQ,'2007')

BUT THIS REQUIRES READING ALL GDGs in order to build a given monthly file. . .

Is there a utility or some "JCL trick" that will allow me to read the System Info of a GDG member in order to pull the file in for inclusion/sorting or skipping to the next gdg if the file shouldn't be included? This would save a ton of processing time by not having to read every record in every gdg member in order to build a current monthly file for that gdg family.

An ISPF command like DSL on a filename & "S" by a given file will net you the Info I'm speaking of trying to get to (LRECL/LBLK/Create-Date, etc)

Thanks for shedding a little light into my dim-dim world!!! :idea:
"Charter member of Vast-Right-Wing-Conspiracy"

acevedo
Member
Posts: 12
Joined: Wed Mar 21, 2007 3:44 pm

Post by acevedo » Tue Apr 03, 2007 11:23 am

you could try something like...

Code: Select all

//*==================================================
//LISTCAT  EXEC PGM=IDCAMS,COND=(0,LT)               
//SYSIN    DD *                                      
 LISTCAT ENT(YOURGDG.HERE) ALL                       
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
or write a small rexx to do the job...

maybe your 'systemers' could give you a better approach...

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Thu Apr 05, 2007 8:29 pm

seagreg,

What ever you have asked can be acheived using the REXX, i mean validatuing the creat date and then sorting based on your condition. But may take some time
for coming up with code...but i am sure it can be done.

Well if you are really looking for code and if its fine in REXX let us know ..we will try to getback to you.

acevedo -> LISTCAST will just give you info reg the all gen's and limit
and other parameters like AIX, INDEX, PATH ENTRIES PROCESSED,
but getting the file creat datea and procesing can be done using rexx.


Thanks,
Veera.

acevedo
Member
Posts: 12
Joined: Wed Mar 21, 2007 3:44 pm

Post by acevedo » Wed Apr 11, 2007 11:14 am

Veera wrote:seagreg,
acevedo -> LISTCAST will just give you info reg the all gen's and limit
and other parameters like AIX, INDEX, PATH ENTRIES PROCESSED,
but getting the file creat datea and procesing can be done using rexx.
that's why I said: or write a small rexx to do the job...

;)

Veera
Moderator
Posts: 111
Joined: Wed Feb 22, 2006 2:59 pm

Post by Veera » Thu Apr 12, 2007 1:37 am

acevedo ->

Yes i accept what you said is correct. Using REXX it can be done.My Intention of quoting reg the LISTCAT was i taught there is a way to
hadnle using it nothing else :)

Well seagreg,

Here is the code for acheving what you have asked for using REXX.

Before that few points to be noted , as i made few assimptions and coded
the REXX routine.

1. I took curr-year and curr-date as refrence.

2. When ever the file-year and file-date are less than the curr-year and
curr-date i have displayed CALL SORT ROUTINE FOR THE FILE else the
file will be skipped.

3. SO what ever process you want to do after selecting the file can be
done using a function/routine where the display CALL SORT ROUTINE
FOR THE FILE is presnet.

Do get back to us if in case of any queries.

Code: Select all


/**************************REXX***************************************/         
/*  THIS ROUTINE WILL CHECK THE FILE CREATION DATE AND COMPARES      */         
/*  WITH THE CURRENT DATE AND THEN VALIDATES WHETHER THE FILE        */         
/*  HAS TO BE PICKED FOR THE FURTHER PROCESSING.                     */         
/*********************************************************************/         
GDGBASE='ABCD.TEST.LIST.*' -> HERE I/P THE GDG BASE FILE                                            
FCCYYDDD = 0                                                                    
FILEYEAR = 0                                                                    
FILEDATE = 0                                                                    
CURRDATE = 0                                                                    
CURRYEAR = 0                                                                    
DSN      = ' '                                                                  
FNAME    = ' '                                                                  
ADDRESS ISPEXEC "LMDINIT LISTID(LISTID) LEVEL("GDGBASE")"                       
ADDRESS ISPEXEC "LMDLIST LISTID("LISTID") OPTION(LIST) DATASET(DSN)"            
RC_LMDLIST = RC                                                                 
DO WHILE(RC_LMDLIST = 0)                                                        
   SAY 'DSN : ' DSN                                                             
   FNAME = DSN                                                                  
CURRDATE = DATE('DAYS')                                                         
CURRYEAR = SUBSTR(DATE('STANDARD'),1,4)                                         
DSNINFO  = LISTDSI("'"FNAME"'")                                                 
   DO                                                                           
      IF  DSNINFO == 0 THEN                                                     
            SAY ' DATASET CREATED DATE ' SYSCREATE                              
      ELSE                                                                      
            NOP                                                                 
   END                                                                          
            FCCYYDDD = SYSCREATE                                                
            FILEYEAR = SUBSTR(FCCYYDDD, 1,4)                                    
            FILEDATE = SUBSTR(FCCYYDDD, 6,3)                                    
            SAY ' DATASET CREATED YEAR ' FILEYEAR                               
            SAY ' DATASER CREATED DATE ' FILEDATE                               
            SAY ' CURENT YEAR          ' CURRYEAR                               
            SAY ' CURRENT DATE         ' CURRDATE                               
      IF FILEYEAR <= CURRYEAR & FILEDATE <= CURRDATE THEN                       
          SAY ' CALL SORT ROUTINE FOR THE FILE '                                
      ELSE                                                                      
          SAY ' CALL SORT ROUTINE SKIPPED      '                                
ADDRESS ISPEXEC "LMDLIST LISTID&#40;"LISTID"&#41; OPTION&#40;LIST&#41; DATASET&#40;DSN&#41;"            
RC_LMDLIST = RC                                                                 
END                                                                             
ADDRESS ISPEXEC "LMDFREE LISTID&#40;"LISTID"&#41;"                                      

Thanks,
Veera.

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others