View previous topic :: View next topic
|
Author |
Message |
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
Please help me out in solving this query:
I have two datasets:
I need to copy common records into third file .
I have searched a lot but couldnot find this solution.
I found that uncommon were copied into third file but i need common to be copied into third file. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Jaffar Hussain,
It's not clear from you description what you want to do exactly.
Please show an example of the records in each input file (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input files. If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
Also, run this job and show the //SYSOUT messages you receive, so I can see what level you're at:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/*
|
|
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
Thanks for your reply.
Input data of file 1 has:
1542124abcdefadmin18071988250009521022154
1002124sdgfcdefHR181219882507895210284121
Input data of file 2 has :
1542124abcdefadmin18071988250009521022154
15477774fdjkgefhr10071990300009521022584
first 7 fields is empid based on that we need to compare and if match need to put it into third file.
Output should be:
1542124abcdefadmin18071988250009521022154
like this all matching records.
As this is the common record in both
LRECL: 80
RECFM: FB
I havenot run the job at all because i have no idea what to use, so thats why i am asking how to solve this using which sort or if you have the code please let me know or any link. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You need to run and post the output of the job Frank provided. . . |
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
Sorry I dint get you .
In th code posted by frank its just copying records .
But i need to copy the common records.
So I should implement some condition.
So which condition should i use INREC fields or OUTREC fields or control cards etc like that. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
In th code posted by frank its just copying records . |
The reason Frank requested this is to see which level of the sort product is being used. The copy means nothing. The informational messages (including the message ids) are needed to proceed.
Just run the job and post the informational output. |
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
1 SYNCSORT FOR Z/OS 1.3.2.0R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSORT INC. DATE=2011
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 7D972, MODEL 2097 710
SYSIN :
OPTION COPY
WER276B SYSDIAG= 591012, 2023107, 2023107, 2443725
WER164B 7,408K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 272K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER410B 5,868K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 156K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0493 TPF LEVEL 2.0
WER052I END SYNCSORT - ACP658Q8,S1,,DIAG=8000,428E,A8AE,0064,C842,6D82,2AE8,4C62
The SYSOUT generated this info. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
also answer this from Frank
Quote: |
If file1 can have duplicates within it, show that in your example. If file2 can have duplicates within it, show that in your example.
|
Gerry |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you are using SYNCSORT and not DFSORT which Frank supports.
Gerry |
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
In both the input files it doesnot have duplicate records. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is an example of what you need :-
Code: |
//FIRST EXEC PGM=SYNCTOOL
//IN1 DD DSN=file1
// DD DSN=file2
//FIRST DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN1) TO(FIRST) ON(1,7,CH) FIRSTDUP
/*
|
Gerry |
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
Thank you very much Gcicchet
|
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
If we have duplicate records in each file then will the same jcl works.
Or need to modifying anything? |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
it will not work without eliminating the duplicate records in each file.
Gerry |
|
Back to top |
|
|
jaffarhussain
New User
Joined: 26 Nov 2010 Posts: 30 Location: Hyderabad
|
|
|
|
ok |
|
Back to top |
|
|
|