Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Synsort shows on the same outfile as the joined records
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Sat May 21, 2011 1:36 am    Post subject: Synsort shows on the same outfile as the joined records
Reply with quote

i have two files to join. But I what the unjoined records to show on the same outfile as the joined records. I have used join before but have not done needed this type of output..... any done this or can you help?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 21, 2011 10:00 am    Post subject:
Reply with quote

Hello,

Show a bit of sample input from both files that contains some matches and some non-matches and the output you want when this sample data is processed.

Mention the recfm and lrecl of all files.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon May 23, 2011 4:03 pm    Post subject: Re: Synsort shows on the same outfile as the joined records
Reply with quote

ken herbolic wrote:
But I what the unjoined records to show on the same outfile as the joined records.
Alos, tell us from which file you need the "un-joined" records, first file, second file or both?
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 5:33 pm    Post subject: Reply to: Synsort shows on the same outfile as the joined re
Reply with quote

Hi:
The input J1 records has an account number in bytes 1 to 9

The input file J2 has an account number also in bytes 1 to 9

Matched output will be done on account number

Non matched output will be accounts numbers that do not matched from J1 to J2.

The data that is in bytes 10 to 90 I know how to do the reformatting.

LRECL on both files is 90.

Thank you,
Ken
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Mon May 23, 2011 6:41 pm    Post subject:
Reply with quote

Hi Ken,

Can you please let us know what is the output that needs to be written to the output file? Do you need data from file 1 or file 2?

It would be better if you can explain the requirement with some sample data?
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 6:46 pm    Post subject:
Reply with quote

Hi:
I need all the data from both J1 an J2.
All account number will be on J1 but some could be missing on J2.
The first 36 bytes of J1 will be displayed first on the output file then bytes 10 to 45 of J2 display on the same output line os J1 right after it.

make sense
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 23, 2011 7:21 pm    Post subject:
Reply with quote

Try using - JOIN UNPARED,F1

That along with what you already know should do it for you.
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 7:28 pm    Post subject:
Reply with quote

thank you !!!!

I will give it a go
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 8:33 pm    Post subject:
Reply with quote

That worked but i now have two account # columns. I would like to show just one account # column. do you know how I could get the account numbers in account column 2 to display in account column 1 then eliminate account column 2.... here is a smaple of the output I have now and the code used to get this far:

Accout # Account #
000000001 001
000000002 002
000010359 258 000010359 258
000010502 2 000010502 2
000010570 11 000010570 11
000010588 90 000010588 90
000010596 2 000010596 2
000023868 15017 000023868 14814

Code:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,9,A)
JOINKEYS FILE=F2,FIELDS=(1,9,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,9,28,11,F2:1,9,45,08)
SORT FIELDS=COPY
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 8:39 pm    Post subject: output
Reply with quote

Sorry that output did not format correctly here is another try:

Account # Account #
000000001 001
000000002 002
000010359 258 000010359 258
000010502 2 000010502 2
000010570 11 000010570 11
000010588 90 000010588 90
000010596 2 000010596 2
000023868 15017 000023868 14814
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 23, 2011 8:40 pm    Post subject:
Reply with quote

Above you said:
Quote:
All account number will be on J1 but some could be missing on J2.


So:
Code:
JOIN UNPAIRED,F1,F2


Should be
Code:
JOIN UNPAIRED,F1


And:
Code:
REFORMAT FIELDS=(F1:1,9,28,11,F2:1,9,45,08)


Should be:
Code:
REFORMAT FIELDS=(F1:1,9,28,11,F2:45,08)
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 8:40 pm    Post subject:
Reply with quote

sorry cannot get the spacing to stay once submitted
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 23, 2011 8:41 pm    Post subject:
Reply with quote

Click the Code button

Paste in you data

Click the Code button
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 8:48 pm    Post subject: I will try this once more to show the format of my output...
Reply with quote

I used dashes to format the data .... As i metioned is there anyway to get the account numbers form F2 to display in the F1 column...then delete the account #s in the F2 column


Code:
Account #F1 --------Account #F2
000000001 ---001
-----------------------000000002 ---002
000010359 ---258 --000010359 ---258
000010502 ------2 --000010502 -----2
000010570 -----11 --000010570 ---11
000010588 -----90 --000010588 ---90
000010596 ------2 --000010596 -----2
000023868 15017 --000023868 14814

Here is the code that is giving me the above results:
Code:
//SYSIN DD *
JOINKEYS FILE=F1,FIELDS=(1,9,A)
JOINKEYS FILE=F2,FIELDS=(1,9,A)
JOIN UNPAIRED,F1,F2
REFORMAT FIELDS=(F1:1,9,28,11,F2:1,9,45,08)
SORT FIELDS=COPY

Thank you !!!
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 23, 2011 8:52 pm    Post subject:
Reply with quote

Did you read my suggestions above?
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 8:53 pm    Post subject:
Reply with quote

Code:

Account #F1           Account #F2
000000001     001
000000002     002
000010359     258   000010359    258
000010502        2   000010502        2
000010570      11   000010570       11
000010588      90   000010588       90
000010596        2   000010596        2
000023868 15017   000023868 14814
[/code]
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 9:02 pm    Post subject:
Reply with quote

Yes ...just tried that now and it is much better thanks!!!..... the output now displays records on F1 that are not on F2 and I have one account number column......Now the only thing left missing is there are records on F2 that are not on F1. These records are not displaying on the output and I need them too. I need to display all records from both files, matched on one line and unmatched on another as the code is doing now for F1.

Is this possiable to do ?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Mon May 23, 2011 9:12 pm    Post subject:
Reply with quote

Earlier you said
Quote:
All account number will be on J1 but some could be missing on J2.


Now you are saying
Quote:
Now the only thing left missing is there are records on F2 that are not on F1. These records are not displaying on the output and I need them too.


My suggestions was for the first requirement, not a changing one.

Sorry, but I do not have the time to code this for you at this point.

There are examples on this forum.

Search for: JOIN UNPARED,F1,F2

Yes, you need to use this one since your requirement has changed.
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 9:18 pm    Post subject:
Reply with quote

thank you...
Back to top
View user's profile Send private message
ken herbolic

New User


Joined: 24 Jan 2011
Posts: 16
Location: buffalo

PostPosted: Mon May 23, 2011 9:38 pm    Post subject:
Reply with quote

Hi.... can anyone else help on this request...I searched but cannot find the requirement I need. Again I have two files. I need to display the account number from both files just once. I need to display all records from both files, matched and unmatched. this is want has been suggested so far and is almost there:
JOINKEYS FILE=F1,FIELDS=(1,9,A)
JOINKEYS FILE=F2,FIELDS=(1,9,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,9,28,11,F2:45,08)
SORT FIELDS=COPY

Here is the output...notice no account number displays for the F2 record.
Code:

000000001     001         
                       002
000010359     258      258
000010502       2        2
000010570      11       11
000010588      90       90
000010596       2        2
000023868   15017    14814
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us