Have you considered using IFTHEN-WHEN constructs?

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Ron Thomas
Sent: Tuesday, May 21, 2024 10:01 AM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: DFSort query

Hi All-

In the below Data we need to extract with in the cross ref nbr , if  seq Nbr 
=1  get Pacct_NBR and its related acct nbrs from the set

In the below dataset for cross ref nbr = 24538 we have 2 sets of data  and 
24531 we have 1 set .



Acct _NBR       Pacct_NBR       LAST_CHANGE_TS  CROSS_REF_NBR   SEQ_NBR
600392811       1762220138659   2024-04-18-10.38.09.570030      24538   1
505756281       1500013748790   2024-04-18-10.38.09.570030      24538   2
59383061        1500013748790   2024-04-18-10.38.09.570030      24538   3
59267071        1500013748790   2024-04-18-10.38.09.570030      24538   4
505756281       1500013748790   2024-01-15-08.05.14.038792      24538   1
59383061        1500013748790   2024-01-15-08.05.14.038792      24538   2
59267071        1500013748790   2024-01-15-08.05.14.038792      24538   3
600392811       1762220138659   2024-01-15-08.05.14.038792      24538   4
600392561       1762220138631   2024-01-15-08.05.14.038792      24531   1

Output

Acct _NBR       Pacct_NBR
600392811       1762220138659
505756281       1762220138659
59383061        1762220138659
59267071        1762220138659
505756281       1500013748790
59383061        1500013748790
59267071        1500013748790
600392811       1500013748790
600392561       1762220138631

Data size
Acct _NBR 10 bytes
Pacct_NBR 15 bytes
LAST_CHANGE_TS 20 bytes
CROSS_REF_NBR  5 bytes
SEQ_NBR 2 bytes

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

Regards
Ron T

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to