|
View previous topic :: View next topic
|
| Author |
Message |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
I have two files of FB 250 , RT is record type
File 1
RT DATA NUM PHONE
| Code: |
1 Kiran 12345 04012345678
2 address 12345 04012345678
3 salary details 12345 04012345678
4 extra information 12345 04012345678
1 Rahul 12346 04012345679
2 address 12346 04012345679
3 salary details 12346 04012345679
1 Hima 12347 04012345670
2 address 12347 04012345670
3 salary details 12347 04012345670
4 extra information 12347 04012345670 |
File 2
| Code: |
1 Kiran
2 address
3 salary details
4 extra information
1 Rahul
2 address
3 salary details
1 Hima
2 address
3 salary details
4 extra information |
I need to compare these two files based on File1 : record type 1 which is in 1st position and Name which is in 4th position with File2 : record type 1 whcih is in 1st position and Name which is in 4th position and copy FILE1 NUM which at position 146 of 5 bytes and Phone which is at 153 of 11 bytes to new file along with file2 data.
My output should looke like
| Code: |
NUM :12345 PHONE:04012345678
1 Kiran
2 address
3 salary details
4 extra information
NUM :12346 PHONE:04012345679
1 Rahul
2 address
3 salary details
NUM :12346 PHONE:04012345670
1 Hima
2 address
3 salary details
4 extra information |
|
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Hima1985,
With some assumptions..See if this helps..
| Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DISP=SHR,DSN=INPUT FILE1
//SORTJNF2 DD DISP=SHR,DSN=INPUT FILE2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(01,01,A,04,60,A,251,8,A)
JOINKEYS FILES=F2,FIELDS=(01,01,A,04,60,A,251,8,A)
JOIN UNPAIRED,F2
REFORMAT FIELDS=(F1:01,64,F1:146,05,F1:153,11)
SORT FIELDS=(65,05,ZD,A,70,11,ZD,A),EQUALS
OUTFIL REMOVECC,BUILD=(1,64),
SECTIONS=(65,05,70,11,
HEADER3=('NUM :',65,05,4X,'PHONE:',70,11))
/*
//JNF1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),
PUSH=(251:ID=8))
//*
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),
PUSH=(251:ID=8))
//* |
OUTPUT
| Code: |
NUM :12345 PHONE:04012345678
1 Kiran
2 address
3 salary details
4 extra information
NUM :12346 PHONE:04012345679
1 Rahul
2 address
3 salary details
NUM :12347 PHONE:04012345670
1 Hima
2 address
3 salary details
4 extra information |
Thanks, |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Here is the error i am getting.
| Code: |
ERROR IN JNF1 PROCESSING
JNF1 STATISTICS
NO KEYWORDS FOUND ON CONTROL STATEMENT |
|
|
| Back to top |
|
 |
Dsingh29
Active User

Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
|
|
| Please post the jcl you are using. |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Dave,
Same one which SQLCODE1 suggested. |
|
| Back to top |
|
 |
Dsingh29
Active User

Joined: 16 Dec 2008 Posts: 132 Location: IBM
|
|
|
|
| I am sure sqlcode1 must have tested the jcl before posting, are you sure you have not messed with the DD names or control card names. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
you left off the message numbers.
are they WER or ICE messages? |
|
| Back to top |
|
 |
gylbharat
Active Member
.jpg)
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
| I think you dont have DFSORT installed. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Hima1985,
Refer to this post and message. it is from syncsort.
ibmmainframes.com/archive/o_t__t_51085__sort-capacity-exceeding-probelm..html
WER486A ERROR IN JNF1 PROCESSING
However, this may still be possible without joinkeys. Please answer or clarify below assumptions.
I see that for each new phone number in file 1, seq number resets to 1. Is that always true? Are you always going to have 1 to 1 match between 2 file meaning 1st record of first phone number group goes with first record of file2's first group?
P.S. The solution posted above works for dfsort and is tested.
Thanks, |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
SQLCODE,
Thanks You, I am getting WER error messages.
Let me explain you the requirement.
File1 have records with record tyeps 1,2,3,4,...etc as well file2 have records with record type 1,2,3,4,5,...etc
we need to copare file1 record type and name associated that record type with file recodd type and name associated with it. record type 1 is always represents name record.
if file1 record type1 name and file2 recordtype1 name matches we need to copy file2 data to output file along with some values from file1 as i mentioned in my first post
file1
RT Name num phno
1 srinu 12345 04012345678
File2
RT name
1 srinu
output
NUM:12345 phno:04012345678
1 srinu
this is what i am expecting. |
|
| Back to top |
|
 |
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1217 Location: Dublin, Ireland
|
|
|
|
| Quote: |
Thanks You, I am getting WER error messages.
|
WER messages are from SYNCSORT - you should post questions about SYNCSORT in the JCL forum.
Garry. |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Gary,
I have both the products in my shop, DFSORT solution also helps me in solving my problem as i can use DFSORT also. |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| I have both the products in my shop, DFSORT solution also helps me in solving my problem as i can use DFSORT also. |
Hima1985,
sqlcode1 gave you a solution that works with DFSORT providing you have the JOINKEYS PTF which has been available since November, 2009. You came back saying that it didn't work with Syncsort which makes sense since DFSORT supports JOINKEYS options that Syncsort doesn't support.
Then you came back saying you have both products but you didn't say if you tried sqlcode1's solution with DFSORT. Did you? If so, what were the results? If it didn't work, show the complete JES log for the DFSORT run including all of the ICExxxs messages. |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Frank,
Oh sorry, just forgot to post that, just tested with DFSORT, it worked like charm. Thanks to sqlcode.
But just curious how can this be achieved with out joinkey? Is it possible?
Thanks |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| Quote: |
But just curious how can this be achieved with out joinkey? Is it possible?
|
TRANSLATION: give me a syncsort solutionl |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Hima1985,
Because you still haven't answered all the questions,I wouldn't be surprised if you come back and inform that the solution isn't working!!!
Thanks, |
|
| Back to top |
|
 |
Hima1985
New User
Joined: 17 Apr 2009 Posts: 70 Location: India
|
|
|
|
Dick Brenholtz,
Thanks for the translation good one , other people in group might have made you to think like that with their posts before, but its not the case with me. Jfyi: I can post this in syncsort link if I want syncsort solution lol |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You have been given a dfsort solution.
Why do you think it appropriate to ask for another?
Maybe there is something i misunderstand
d |
|
| Back to top |
|
 |
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
Hima1985,
See if below works. Below is the content of TEST.FB250DM which is 250 bytes/FB file.
I don't have syncsort documentation and hence I don't really know if the solution mentioned is supported or not with your Syncsort function level but I really "hope" it should work for your requirement.
| Code: |
//STEP0001 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=TEST.FB250DM
// DD DISP=SHR,DSN=TEST.FB25001 --> file1
// DD DISP=SHR,DSN=TEST.FB250DM
// DD DISP=SHR,DSN=TEST.FB25002 --> file2
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(251:ID=1)),
IFTHEN=(WHEN=GROUP,BEGIN=(1,1,ZD,EQ,1),
END=(1,1,ZD,EQ,4),PUSH=(252:4,30))
SORT FIELDS=(252,30,CH,A),EQUALS
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(283:SEQNUM,8,ZD,RESTART=(252,30))),
IFTHEN=(WHEN=GROUP,BEGIN=(283,8,ZD,EQ,1),
PUSH=(291:146,5,296:153,11))
OUTFIL BUILD=(1,31,132:X),
INCLUDE=(251,1,ZD,EQ,2,AND,1,3,CH,NE,C'$$$'),
SECTIONS=(291,16,
HEADER3=('NUM :',291,05,4X,'PHONE:',296,11,132:X))
/* |
OUTPUT
| Code: |
NUM :12347 PHONE:04012345670
1 Hima
2 address
3 salary details
4 extra information
NUM :12345 PHONE:04012345678
1 Kiran
2 address
3 salary details
4 extra information
NUM :12346 PHONE:04012345679
1 Rahul
2 address
3 salary details
|
Thanks, |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|