|
View previous topic :: View next topic
|
| Author |
Message |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 159 Location: India
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
| Sample Input and Sample Output, as usual please. |
|
| Back to top |
|
 |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 159 Location: India
|
|
|
|
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 |
|
 |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 159 Location: India
|
|
|
|
| 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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10900 Location: italy
|
|
|
|
| just take a decision ... 5 or 6 chars |
|
| Back to top |
|
 |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 159 Location: India
|
|
|
|
| Sorry it should be 5 character |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
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 |
|
 |
Digvijay Singh
Active User
Joined: 20 Apr 2022 Posts: 159 Location: India
|
|
|
|
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 |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1424 Location: Bamberg, Germany
|
|
|
|
| The process will be fast enough as SORT is optimized for huge amounts of data. |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
|
|