IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compare the member of two pds on last 6 character of member


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 159
Location: India

PostPosted: Wed Oct 08, 2025 3:55 pm
Reply with quote

Hello all,

I have two pds , pds1 and pds2 I want to compare the member's name last 5 characters of member name form both the pds file if they are not matching, they should be copied to another file basically need all the member which last 5 character are not matching in both the file.

I tried with super c I am able to do for all the member's name I only want to compare the last 5 character of member name.

any suggestion or any link would be great help here.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1424
Location: Bamberg, Germany

PostPosted: Wed Oct 08, 2025 4:14 pm
Reply with quote

Sample Input and Sample Output, as usual please.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 159
Location: India

PostPosted: Wed Oct 08, 2025 6:04 pm
Reply with quote

Sample input:
PDS1: contain members (job names)
JOBABC01
JOBABC0A
JOBABC0B

PDS2: contains members (job names)

JOBABC06
JOBABC0Z
JOBABC0B

Sampel output : all the unique member name comparison sould be only last 5 character of member name which are not matching should come in one ps file.

Sample output:
PS1:
JOBABC01
JOBABC0A
JOBABC06
JOBABC0Z

PS file contains all the member which are not matching please note we matching criteria is last 5 character of member name or job name.
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 159
Location: India

PostPosted: Wed Oct 08, 2025 9:04 pm
Reply with quote

Dnt get confused I only want to copy member name not the content of the member basis on criteria last 6 character of member name as explained above. Please help me here.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10900
Location: italy

PostPosted: Wed Oct 08, 2025 10:09 pm
Reply with quote

just take a decision ... 5 or 6 chars
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 159
Location: India

PostPosted: Wed Oct 08, 2025 10:17 pm
Reply with quote

Sorry it should be 5 character
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Thu Oct 09, 2025 5:50 am
Reply with quote

Digvijay Singh wrote:
Dnt get confused I only want to copy member name not the content of the member basis on criteria last 6 character of member name as explained above. Please help me here.


What "copy member name" stands for?
"Copy" what entity? From where? To where?
Please, explain.

It looks like your task has nothing to do with PDS, or whatever.
It is only classical task like "outer join of two flat tables", and nothing else.
There are approximately 100500 available tools and algorithms to perform this operation.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Thu Oct 09, 2025 6:50 am
Reply with quote

If not to consider different name length, then this "task" has nothing to talk about, absolutely.

Code:
//*=============================================
//GENFILE  EXEC PGM=SORT                         
//SYSOUT   DD  SYSOUT=*                           
//*                                               
//*SORTIN   DD  DDNAME=PDS1                       
//PDS1     DD  *                                 
JOBABC01                                         
JOBABC0A                                         
JOBABC0B                                         
OBABC11                                           
BABC1A                                           
ABC1B                                             
//PDS2     DD  *                                 
JOBABC06                                         
JOBABC0Z                                         
JOBABC0B                                         
OBABC16                                           
BABC1Z                                           
ABC1B                                             
//SYSIN    DD  *                                 
 JOINKEYS F1=PDS1,                               
          FIELDS=(84,5,A)                         
 JOINKEYS F2=PDS2,                               
          FIELDS=(84,5,A)                         
 JOIN UNPAIRED,F1,F2,ONLY                         
 REFORMAT FIELDS=(F1:1,8,F2:1,8),FILL=X'00'       
 SORT FIELDS=COPY                                                     
 OUTREC IFTHEN=(WHEN=(1,1,CH,NE,X'00'),                               
                BUILD=(1,8)),                                         
        IFTHEN=(WHEN=NONE,                                             
                BUILD=(9,8))                                           
 END                                                                   
//*                                                                   
//JNF1CNTL DD  *                                                       
 INREC OVERLAY=(81:1,8,JFY=(SHIFT=RIGHT))                             
//*                                                                   
//JNF2CNTL DD  *                                                       
 INREC OVERLAY=(81:1,8,JFY=(SHIFT=RIGHT))                             
//*                                                                   
//SORTOUT  DD  SYSOUT=*                                               
//*=============================================


Code:
********************************* TOP OF DATA ****
JOBABC0A                                         
JOBABC0Z                                         
JOBABC01                                         
JOBABC06                                         
BABC1A                                           
BABC1Z                                           
OBABC11                                           
OBABC16                                           
******************************** BOTTOM OF DATA **
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1424
Location: Bamberg, Germany

PostPosted: Thu Oct 09, 2025 4:11 pm
Reply with quote

IMHO it can be a tiny bit simplified. I do not have access to a system at the moment.

Code:
 JOINKEYS F1=PDS1,                               
          FIELDS=(84,5,A)                         
 JOINKEYS F2=PDS2,                               
          FIELDS=(84,5,A)                         
 JOIN UNPAIRED,ONLY                         
 REFORMAT FIELDS=(F1:1,8,F2:1,8)       
 SORT FIELDS=COPY                                                     
 OUTREC BUILD=(1,16,SHIFT=(LEFT,LENGTH=8))
 END
Back to top
View user's profile Send private message
Digvijay Singh

Active User


Joined: 20 Apr 2022
Posts: 159
Location: India

PostPosted: Thu Oct 09, 2025 8:18 pm
Reply with quote

Thanks for your reply here,

Problem is here i have almost 3 to 4 thousand members in each PDS . I tried many things but i could not achieve this. For few members it is fine but i have thousands of members in each PDS.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1424
Location: Bamberg, Germany

PostPosted: Fri Oct 10, 2025 12:39 am
Reply with quote

The process will be fast enough as SORT is optimized for huge amounts of data.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Fri Oct 10, 2025 7:40 pm
Reply with quote

Digvijay Singh wrote:
Thanks for your reply here,

Problem is here i have almost 3 to 4 thousand members in each PDS . I tried many things but i could not achieve this. For few members it is fine but i have thousands of members in each PDS.


For this elementary operation in SORT, no problem found when handling 300,000,000 records and more, longer than 8 bytes.

P.S. Once again: there is no PDS involved into this particular operation.
Don't add more mess than there really is.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Fri Oct 10, 2025 8:53 pm
Reply with quote

The more straightforward question:

How do you plan to get the list of your PDS member names as text data, before doing any manipulation with the names? (Not with the PDS members!!!)
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2263
Location: USA

PostPosted: Sun Oct 12, 2025 10:29 pm
Reply with quote

Joerg.Findeisen wrote:
IMHO it can be a tiny bit simplified. I do not have access to a system at the moment.

Code:
 JOINKEYS F1=PDS1,                               
          FIELDS=(84,5,A)                         
 JOINKEYS F2=PDS2,                               
          FIELDS=(84,5,A)                         
 JOIN UNPAIRED,ONLY                         
 REFORMAT FIELDS=(F1:1,8,F2:1,8)       
 SORT FIELDS=COPY                                                     
 OUTREC BUILD=(1,16,SHIFT=(LEFT,LENGTH=8))
 END

This is true when the "task" is limited to something like "printing the list of mismatching names".

In real life, the list of the found names needs to be used for subsequent processing, such as "creating the list of MEMBER NAME= statements" for IEBCOPY utility, or whatever else. In such more complex situations the solution with IFTHEN may work, while the solution with SHIFT=LEFT may not...
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts creat new line command in front of Me... TSO/ISPF 4
No new posts PDS member list with stats JCL & VSAM 6
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts Help with C character vs C string All Other Mainframe Topics 3
Search our Forums:


Back to Top