SYNCOSRT challenging data manupulation.....



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

SYNCOSRT challenging data manupulation.....

Postby rmd3003 » Wed Nov 23, 2011 2:13 am

Hello there. It would be great if some of the gurus here would show me how this can be done (if it's doable...)

I have VSAM file (500 bytes length).
Key is PIC 9(15) COMP-3 in POS 1. It contains so called reversed timestamp.
When this field is created it's calculated this way:
99999999999999 minus current-date-time (CCYYMMDDHHMMSS)
For example todays date 20111122000000 will be stored as 79888877999999

So file looks like this:

 REVERSED TIMESTAMP
79889898999999    this is just to show value 20110101000000   
79889798999999    this is just to show value 20110201000000
79889698999999    this is just to show value 20110301000000
79889598999999    this is just to show value 20110401000000
79889498999999    this is just to show value 20110501000000
79889398999999    this is just to show value 20110601000000
79889298999999    this is just to show value 20110701000000
79889198999999    this is just to show value 20110801000000
79889098999999    this is just to show value 20110901000000
79888998999999    this is just to show value 20111001000000
79888898999999    this is just to show value 20111101000000
79888798999999    this is just to show value 20111201000000


Now, I need to delete (OMIT) records where reversed timestamp (POS 1 PIC9(15) COMP-3) is over 90 days old.

I tried different combinations but failed :oops:

Please let me know if it's impossible to do in SYNCSORT.
rmd3003
 
Posts: 6
Joined: Wed Nov 23, 2011 1:27 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCOSRT challenging data manupulation.....

 

Re: SYNCOSRT challenging data manupulation.....

Postby BillyBoyo » Wed Nov 23, 2011 5:25 am

What different combinations did you try, and how did it fail?

When you say you have a VSAM file 500 bytes in length, presumably you are referring to records, not to the length of the file/dataset?

If you look at the DEFINE or a LISTCAT of the VSAM file, what do you have for the maximum and minimum record lengths? This will tell you if you have a file you can treat as "Fixed" length or whether it should be "Variable" length.


PIC S9(15) is, in sort-speak, a PD which is 8 bytes long. You need a start position to go with the length. If the records are variable in length, you have to add four for the "RDW" information, for fixed-length records, you just need the start position unadjusted.

 OMIT COND=(x,8,PD,GT,value)
where x is your appropriate start position and value is that of the 90-day-old reverse-timestamp (any idea why that has been done, by the way?).

Next you'll want to know how to avoid "hard-coding" the 90-day value, but get this bit working first please and let us know.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post