Selecting by Date Logic



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Selecting by Date Logic

Postby ectgunner64 » Thu Mar 22, 2012 9:14 pm

I am trying to set up a job that will run at various times during the year and needs to select only records that have a certain date field that has been modified in the last 4 years. I would like to set this up so that the include paramater will not have to be changed every time the job runs. Here is some sample data: (Date field is in MMDDYY format in columns 13-18)

JOHN DOE 052711
ANN JONES 072109
ED DAVIS 032508
BILL SMITH 121507

If my job ran today (03/22/2012), I would like it to pick up the first 3 records but not the last record. If this job runs on April first of this year (04/01/2012), I would like it to pick up just the first 2 records since record 3 would then be more than 4 years old.

I can use the following INCLUDE card to do this selection today, but then I would have to change it on April first to then not pick up the third record:

INCLUDE=((17,2,CH,GT,C'07'),OR,(17,2,CH,EQ,C'07',AND,13,4,CH,LE,C'0322'))

Can anyone find a way to do this without having to change the hard-coded year (07) and/or the hard-coded month and day (0322)?

Thanks.
ectgunner64
 
Posts: 8
Joined: Wed Sep 07, 2011 8:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Selecting by Date Logic

Postby BillyBoyo » Thu Mar 22, 2012 9:18 pm

What version of Syncsort do you have? With the latest, you can, I believe, supply data as a PARM into the sort cards.

If you are not the latest, then a generated Symbol on SYMNAMES might do it for you. If you don't want to code in the INCLUDE, it has to be somewhere - a member of a PDS OK with you?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Selecting by Date Logic

Postby ectgunner64 » Thu Mar 22, 2012 9:20 pm

Our version is 1.3.2.1R.
ectgunner64
 
Posts: 8
Joined: Wed Sep 07, 2011 8:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Selecting by Date Logic

Postby BillyBoyo » Thu Mar 22, 2012 9:40 pm

OK, no-go with the PARM then.

You didn't answer the other question... where do you want to put the information for the run? File is good. PARM, you have to use something which turns it into a file, or which can generate a particular format:

OLDEST-YEAR-FOR-RUN,C'xx'
MM-DD-FOR-SELECTION,C'xxxx'


You make those cards on a dataset (can be temporary) and read them from a SYMNAMES DD statement in the sort step. Include a SYMNOUNT DD as well (or whatever Syncsort uses). Then replace the "hard-coding" with the symbol names. Run. Enjoy.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Selecting by Date Logic

Postby ectgunner64 » Fri Mar 23, 2012 12:33 am

You are correct that the output is to be another file with the selected records.

If I understand what you have suggested, it appears to me that the SYMNAMES input file itself would need to be modified each time this job is run, so I don't think that will allow "hands off" processing once this job is put into a production status. Is there an "automated" way that this file can be populated without having to write a program to do this?

Thanks for working on this for me.
ectgunner64
 
Posts: 8
Joined: Wed Sep 07, 2011 8:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Selecting by Date Logic

Postby BillyBoyo » Fri Mar 23, 2012 2:07 am

You need to source your selection from somewhere.

If this can be a file, the SYMNAMES can be generated, concatenated with any other SYMNAMES you have (if you do). The SORT cards use the symbols. Only the value for the symbols changes, sourced from wherever you decide.

If you want to put the selection information as a PARM to something, that something has to put the data on a file somewhere, either already in SYMNAMES format or such that it can be done as a post-process to that.

Once set up, the only thing that actually changes is the date values that you put in.

You need to solve that part. The SYMNAMES bit is easy.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post