Hi Skolusu, thanks so much for your reply, information and link....and thanks Dick for not laughing and motivating me to go on
Skolusu do I get this right...I have to declare all the needed fields from f1 and f2 related to the needed sequence in both statements...the reformat and the built statement...then it's all clear to me...I was a bit confused about the given example...because... I thought...how does the given reformat and the build fit/work together...
Code:
REFORMAT FIELDS=(F1:1,4,?,F2:5,2796,F1:5)
INREC IFTHEN=(WHEN=(5,1,CH,EQ,C'B'), $ MATCH RECORDS
BUILD=(0001,04, $ RDW
2802,95, $ DATA BEFORE ADDRESS1
0201,25, $ REPLACED DATA1 FROM FILE2
2922,25, $ DATA BEFORE ADDRESS2
0251,25, $ REPLACED DATA2 FROM FILE2
2972)), $ REST OF THE FILE VB DATA
IFTHEN=(WHEN=NONE, $ NON-MATCH RECORDS
BUILD=(1,4,2802)) $ BUILD AS-IS
But I guess I understand now...and try as said tomorrow...however...
super nice time to you and Dick!!!
I appreciate all the help so much...thx!!
PS: normally we write very quick a cobol program for that task...but I like to learn to solve that also by DFSORT
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
wabasaja wrote:
Skolusu do I get this right...I have to declare all the needed fields from f1 and f2 related to the needed sequence in both statements...the reformat and the built statement...then it's all clear to me...I was a bit confused about the given example...because... I thought...how does the given reformat and the build fit/work together...
Wabasaja,
You need to understand how Joinkeys works. With JOINKEYS there are 3 tasks done.
TASK-1 - FILE1 is sorted on the key fields and matched
TASK-2 - FILE2 is sorted on the key fields and matched.
Builds the Matched records using REFORMAT statement. This will be passed as New SORTIN record to
3. Main task - Here you can sort/modify the new built matched record.
In simple terms, the REFORMAT statement is building a RECORD during MATCH. So when the keys match a new record is built with the fields specified on the REFORMAT statement. Once the match record is built , the INREC is actually building the record according to our needs picking the necessary fields.
Good teacher…allow me to say ….good friend ;-)....normally nobody helps like you do….that’s really amazing…and beyond a friendly response / reaction…
so I must say..it’s a help..support like normally only friends give :-)…
I will save the given links and information until the end of my days ;-)…
Very good information…Thx!!!
I’m somehow (I know …it’s my personal problem..) under stress the last days …and still today…so I couldn’t try like I wish…maybe finally tomorrow…
But after quick repeated test with the given syntax I get always 6 leading spaces…I played with the numbers of the positions… I can’t get rid of the leading blanks..
It’s looks like that….the “AAAAAA……” would be so far the wished data from F1.
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
****** ***************************** Top of Data ******************************
000001 AAAAAABBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEE
000002 AAAAAABBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEE
000003 AAAAAABBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEE
000004 AAAAAABBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEE
000005 AAAAAABBBBBBBBBCCCCCCCCCCCCCCCCCDDDDDDDDDDDDDDDDDDDDDEEEEEEEEEEEEE
****** **************************** Bottom of Data ****************************
I didn't checked the rest so far…and I’m sure it’s my fault….I go on tomorrow…hopefully
I’m aware that I should show more details…and I will if don’t get it solved…but now I have to join a meeting..
As all times…the problem was sitting in front of the keyboard ;-)….I made a mistake on the numbers on the “when=none” side….and for sure
received an impact on the “eq side”…
So finally again…super thanks for helping me so super friendly :-)!!!
Have a nice on…
PS: btw…has the name / word skolusu something to do with…”the schools are..”
First of all…I hope you had a nice summertime and you are doing well!!!
You gave me some month ago your super supportive help related to the below JCL/DFSORT.
Is it possible to get btw..lets say as a byproduct within the same step… “all keys of F2 which are not in F1” if some use
“JOIN UNPAIRED,F1“?
INREC IFTHEN=(WHEN=(5,1,CH,EQ,C'B'), $ MATCH RECORDS
BUILD=(0001,04, $ RDW
2802,95, $ DATA BEFORE ADDRESS1
0201,25, $ REPLACED DATA1 FROM FILE2
2922,25, $ DATA BEFORE ADDRESS2
0251,25, $ REPLACED DATA2 FROM FILE2
2972)), $ REST OF THE FILE VB DATA
IFTHEN=(WHEN=NONE, $ NON-MATCH RECORDS
BUILD=(1,4,2802)) $ BUILD AS-IS
//*
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Yes, the way it is coded you'd need UNPAIRED,F1,F2 and you'd need your code to identify the "on 2 only" (5,1,CH,EQ,C'2') as an IFTHEN=(WHEN= before the IFTHEN=(WHEN=NONE).
You then include, in your BUILD associated with the IFTHEN=(WHEN=, the appropriate fields from the REFORMAT record which have been originally sourced from F2.