SYNCSORT to match 2 files and write selected info



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

SYNCSORT to match 2 files and write selected info

Postby manjeera.bonakurthi » Fri Feb 19, 2010 11:04 am

Hi....
I need to compare two files using SORT based on composit key (Acc.no+time+date)(which is present in both files).
If it is same for specific records in two files then I have to write the Trnsction number field(which is present in both files) for that perticular rec.into a third file.
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT to match 2 files and write selected info

Postby dick scherrer » Fri Feb 19, 2010 11:20 am

Hello and welcome to the forum,

When you have a question, please start a new topic for your question (your question has been split into a new topic).

For someone to help, you need to post some sample input data from both files and the output you want from this input. Mention the relevant data positions and the recfm and lrecl of the files. The sample data should include all possible data combinations (i.e. mis-matched data, duplicate keys, etc). When posting data use the "Code" tag to preserve alignment and improve readability.

Explain any rules for getting from the input to the output.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SYNCSORT to match 2 files and write selected info

Postby manjeera.bonakurthi » Fri Feb 19, 2010 11:43 am

Thank u for ur suggession ...

I have two i/p files like this..

File 1 :
Tras-id acc.no date     time     amt
1       1234   12/3/10  12:20:23 5000
2       1234   04/3/10  12:20:23 5000
3       2345   11/4/10  11:34:28 10000
4       2345   05/4/10  04:45:28 10000


File 2:
Tras-id acc.no date     time     amt
11      1234   12/3/10  12:20:23 5000
22      1234   05/3/10  01:45:23 5000
33      2345   05/4/10  04:45:28 10000
44      4567   01/4/10  11:34:28 10000

I want o/p file to b..( i have to match acc.no ,date n time in both files)...

File 3
1 11
4 33


edited: coded
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT to match 2 files and write selected info

Postby Alissa Margulies » Fri Feb 19, 2010 10:38 pm

Here is a SyncSort for z/OS job that will produce your requested output:
//SORT1  EXEC PGM=SORT                             
//SORTJNF1 DD *                                   
1       1234   12/3/10  12:20:23 5000             
2       1234   04/3/10  12:20:23 5000             
3       2345   11/4/10  11:34:28 10000           
4       2345   05/4/10  04:45:28 10000           
//SORTJNF2 DD *                                   
11      1234   12/3/10  12:20:23 5000             
22      1234   05/3/10  01:45:23 5000             
33      2345   05/4/10  04:45:28 10000           
44      4567   01/4/10  11:34:28 10000           
//SORTOUT  DD SYSOUT=*                             
//SYSOUT   DD SYSOUT=*                             
//SYSIN    DD *                                     
   JOINKEYS FILES=F1,FIELDS=(9,4,A,16,8,A,25,8,A)
   JOINKEYS FILES=F2,FIELDS=(9,4,A,16,8,A,25,8,A)
   REFORMAT FIELDS=(F1:1,2,F2:1,2)               
   SORT FIELDS=COPY                               
/*                                               
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: SYNCSORT to match 2 files and write selected info

Postby manjeera.bonakurthi » Mon Feb 22, 2010 10:57 am

Hi...
Thank u for your solution.
But when am trying this giving a sortout file ... am getting an empty file..
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT to match 2 files and write selected info

Postby dick scherrer » Mon Feb 22, 2010 11:10 am

Hello,

Do not post "it didn't work". . . This provides nothing for anyone to use to help tou.

You need to post the job you submitted (jcl and sort control), the informational output from the sort and a bit of the actual inputs.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SYNCSORT to match 2 files and write selected info

Postby manjeera.bonakurthi » Mon Feb 22, 2010 1:58 pm

This is the info of two i/p files.. Data Set Information
Command ===>

Data Set Name . . . . : WXX093.MANJEERA.TEST1

General Data Current Allocation
Management class . . : TPS035 Allocated cylinders : 1
Storage class . . . : DEFAULT Allocated extents . : 1
Volume serial . . . : MIZABB
Device type . . . . : 3390
Data class . . . . . : NONSTD Current Utilization
Organization . . . : PS Used cylinders . . : 1
Record format . . . : VB Used extents . . . : 1
Record length . . . : 80
Block size . . . . : 800
1st extent cylinders: 1
Secondary cylinders : 3
Data set name type : SMS Compressible : NO

Creation date . . . : 2010/02/18 Referenced date . . : 2010/02/21
Expiration date . . : ***None***




Data Set Name . . . . : WXX093.MANJEERA.TEST2

General Data Current Allocation
Management class . . : TPS035 Allocated cylinders : 1
Storage class . . . : DEFAULT Allocated extents . : 1
Volume serial . . . : MIZAA1
Device type . . . . : 3390
Data class . . . . . : NONSTD Current Utilization
Organization . . . : PS Used cylinders . . : 1
Record format . . . : VB Used extents . . . : 1
Record length . . . : 80
Block size . . . . : 800
1st extent cylinders: 1
Secondary cylinders : 3
Data set name type : SMS Compressible : NO

Creation date . . . : 2010/02/18 Referenced date . . : 2010/02/21
Expiration date . . : ***None***


These are the contents of two i/p files

WXX093.MANJEERA.TEST1

000001 1 1234 12/3/10 12:20:23 5000
000002 2 1234 04/3/10 12:20:23 5000
000003 3 2345 11/4/10 11:34:28 10000
000004 4 2345 05/4/10 04:45:28 10000

WXX093.MANJEERA.TEST2

11 1234 12/3/10 12:20:23 5000
22 1234 05/3/10 01:45:23 5000
33 2345 05/4/10 04:45:28 10000
44 4567 01/4/10 11:34:28 10000

This is the jcl i have submitted....

//PS010 EXEC PGM=SORT
//*
//* INPUT FILE
//*
//SORTJNF1 DD DSN=WXX093.MANJEERA.TEST1,
// DISP=SHR
//SORTJNF2 DD DSN=WXX093.MANJEERA.TEST2,
// DISP=SHR
//*
//SORTOUT DD DSN=WXX093.MANJEERA.OUT,
// DISP=(NEW,CATLG,CATLG)
//*
//*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(9,4,A,16,8,A,25,8,A)
JOINKEYS FILES=F2,FIELDS=(9,4,A,16,8,A,25,8,A)
REFORMAT FIELDS=(F1:1,2,F2:1,2)
SORT FIELDS=COPY
/*
//SYSOUT DD SYSOUT=*
//*
//SYSPRINT DD SYSOUT=*
//*
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT to match 2 files and write selected info

Postby manjeera.bonakurthi » Mon Feb 22, 2010 3:03 pm

This is the first i/p file..WXX093.MANJEERA.TEST1

1 1234 12/3/10 12:20:23 5000
2 1234 04/3/10 12:20:23 50000
3 3 2345 11/4/10 11:34:28 10000
4 4 2345 05/4/10 04:45:28 10000
manjeera.bonakurthi
 
Posts: 13
Joined: Fri Feb 19, 2010 10:54 am
Has thanked: 0 time
Been thanked: 0 time

Re: SYNCSORT to match 2 files and write selected info

Postby Alissa Margulies » Mon Feb 22, 2010 9:14 pm

Please use code tags for your input records so we can see the actual field positions. Thank you.
For example
[code]
1 1234 12/3/10 12:20:23 5000
2 1234 04/3/10 12:20:23 50000
3 3 2345 11/4/10 11:34:28 10000
4 4 2345 05/4/10 04:45:28 10000
[/code]
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: SYNCSORT to match 2 files and write selected info

Postby arcvns » Wed Feb 24, 2010 11:07 am

JOINKEYS FILES=F1,FIELDS=(9,4,A,16,8,A,25,8,A)
JOINKEYS FILES=F2,FIELDS=(9,4,A,16,8,A,25,8,A)
The key fields are at different positions in the input files shown by you. But you have mentioned the same field positions in the sort card you used. Change the field positions as per the actual field positions and rerun your sort job or else post the starting position and length of each relevant field along with some sample input data using "Code" tags.
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post