Query for an utility to copy records on condition

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
nagesh divvela
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Query for an utility to copy records on condition

Post by nagesh divvela » Tue Mar 30, 2010 12:58 am


I have a dataset which would be having the dataset name with date qualifier like beow, where the last qualifier is the date(MMDDYY) :


I wanted to copy all the file name that have been created before particular date which will be read from another file to purge them through IDCAMS step.

The other data set would be having the date like below :


So the new dataset which has to be created for purging by IDCAMS should be like :


So, can some one help me in meeting this requirement.
I hope the requirement is clear for all, if you can suggest me any other way of purging the datasets in the file is even fine.

Nagesh D.

User avatar
Frank Yaeger
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA

Post by Frank Yaeger » Tue Mar 30, 2010 4:15 am

Is 250310 a ddmmyy date? What is the RECFM and LRECL of that file?

What is the RECFM and LRECL of the file with the dataset names? Does the mmddyy date in this file always start in position 20, or can it start in other positions. If the mmddyy date can start in different positions in different records, then what are the "rules" for finding the starting position of the date?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

nagesh divvela
Posts: 16
Joined: Sun Dec 27, 2009 12:37 pm

Post by nagesh divvela » Tue Mar 30, 2010 5:05 pm

Hi Frank,

Thanks for the reply and the query.
Both the data sets are of LRECL 80 only, the data mmddyy would be starting from position 1 itself in the other dataset.

So it will be like, one dataset will be having the date value in the first six chars and the other would be having the data set names starting from position 1 itself. All the dataset names will be of the same length differing only by the last date qualifier.

Let me know in case of any queries

Nagesh D

Posts: 43
Joined: Sat Jul 26, 2008 12:38 am

Post by skolusu » Tue Mar 30, 2010 9:11 pm

nagesh divvela,

First of all you canNOT have a DSN name with numeric as the first qualifier. so your dataset names are not even valid


Look up ADRDSSU which lets you delete the datasets with wild cards and creation dates
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:

Post Reply


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.
Mainframe Interview questions

Other References
Mainframe Tools and others