Ron,

You have been a member on this forum for a long time and yet you post questions 
which lack basic data.

What is the LRECL and RECFM of the input file?

>> LAST_CHANGE_TS 20 bytes

The sample data you posted shows the timestamp as 26 bytes which would change 
the position of the sequence number which you want to validate to pull the 
desired records.

>> Could someone please let me know how we can build this data using dfsort ?

If you had searched, you would have found the DFSORT Smart trick “Include or 
omit groups of records”  which caters to your exact requirement.

https://www.ibm.com/support/pages/smart-dfsort-tricks

Either way here is a DFSORT JOB that would give you the desired results based 
on the following assumptions.

1.  Input file has RECFM=FB
2.  The sequence number starts at position 57 for 2 bytes with the leading zero 
suppressed.
3. If your input file has RECFM=VB, then you are on your own to modify the job 
shown below

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ACCT _NBR PACCT_NBR LAST_CHANGE_TS CROSS_REF_NBR SEQ_NBR
600392811 1762220138659  2024-04-18-10.38.09.57003024538 1
505756281 1500013748790  2024-04-18-10.38.09.57003024538 2
59383061  1500013748790  2024-04-18-10.38.09.57003024538 3
59267071  1500013748790  2024-04-18-10.38.09.57003024538 4
505756281 1500013748790  2024-01-15-08.05.14.03879224538 1
59383061  1500013748790  2024-01-15-08.05.14.03879224538 2
59267071  1500013748790  2024-01-15-08.05.14.03879224538 3
600392811 1762220138659  2024-01-15-08.05.14.03879224538 4
600392561 1762220138631  2024-01-15-08.05.14.03879224531 1
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
               BEGIN=(57,2,UFF,EQ,1),
                PUSH=(60:11,15,
                      75:57,02))

  OUTFIL INCLUDE=(75,02,UFF,EQ,1),
           BUILD=(01,10,
                  60,15)
/*


Thanks,
Kolusu
DFSORT Development
IBM Corporation





----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to