compare number lines of two dataset



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

compare number lines of two dataset

Postby samb01 » Wed Nov 13, 2024 8:46 pm

Hello. Instead do it by a REXX program,i would like to compare the number of lines of two datasets.
If the number is equal, it's ok, if it's not, it's not ok.
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: compare number lines of two dataset

Postby sergeyken » Wed Nov 13, 2024 9:26 pm

What exactly prevents you from doing what you want? ;)
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: compare number lines of two dataset

Postby sergeyken » Wed Nov 13, 2024 10:46 pm

//CNTLINES EXEC PGM=SORT
// . . . . . .
//FIRST    DD  DISP=SHR,DSN=dataset1
//SECOND   DD  DISP=SHR,DSN=dataset2
//SYSIN    DD  *
 JOINKEYS F1=FIRST,
          FIELDS=(1,8,A),SORTED
 JOINKEYS F2=SECOND,
          FIELDS=(1,8,A),SORTED
 JOIN UNPAIRED,ONLY
 REFORMAT FIELDS=(F1:1,8,F2:1,8),FILL=С'-'
 OUTFIL NOTMTOFL=RC4         RC=4 ==> different number of records      
//CNTLJNF1 DD  *
 INREC BUILD=(SEQNUM,8,ZD)
//CNTLJNF2 DD  *
 INREC BUILD=(SEQNUM,8,ZD)
//SORTOUT DD  SYSOUT=*
// . . . . . . .
 
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: compare number lines of two dataset

Postby samb01 » Thu Nov 14, 2024 1:42 am

Hi. Thank's. I just didn't know i have to use Joinkeys.
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: compare number lines of two dataset

Postby sergeyken » Thu Nov 14, 2024 6:16 pm

samb01 wrote:Hi. Thank's. I just didn't know i have to use Joinkeys.

This is one way of doing this.
Other options are possible, too.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: compare number lines of two dataset

Postby samb01 » Thu Nov 14, 2024 6:36 pm

Thank's sergeyken.
Could you just shwo me an other example like i will be able to try the twi solutions ?

Thank's a lot for your help.
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: compare number lines of two dataset

Postby sergeyken » Fri Nov 15, 2024 12:41 pm

samb01 wrote:Thank's sergeyken.
Could you just shwo me an other example like i will be able to try the twi solutions ?

Thank's a lot for your help.

This is not DO-MY-JOB-FOR-ME forum.

You can create TOTAL COUNT single record for each of input datasets, and then: compare those two records.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post