IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Join to VB files and update certain adresses of F1 by F2


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Wed Aug 01, 2012 2:37 am
Reply with quote

Hi Skolusu, thanks so much for your reply, information and link....and thanks Dick for not laughing and motivating me to go on icon_wink.gif

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

Code'd
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Aug 01, 2012 10:28 pm
Reply with quote

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.

Check this link for the flow of JOINKEYS

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.1.1?DT=20110608113434#FIGJKAPP

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.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Aug 02, 2012 10:39 pm
Reply with quote

Hi Skolusu,

biggest thanks!!

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..


Have a super nice day…evening!!!
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Aug 02, 2012 10:43 pm
Reply with quote

wabasaja,

I need to see the control cards and complete sysout to figure out why you are getting the extra spaces.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Fri Aug 03, 2012 9:20 pm
Reply with quote

Hi Skolusu,

Now I get it!

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..”
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Aug 04, 2012 12:02 am
Reply with quote

wabasaja wrote:
Hi Skolusu,

Now I get it!
PS: btw…has the name / word skolusu something to do with…”the schools are..”


Glad you figured it on your own. Sorry to disappoint you but my name has got nothing to do with schools.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Sat Aug 04, 2012 3:17 am
Reply with quote

Hi skolusu, I just asked about the name because I saw that
"Skolu su" in Cze ch means "the schools are".. icon_wink.gif
Thx2u
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Mon Oct 29, 2012 10:26 pm
Reply with quote

Hi Skolusu,

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“?

Super Thx for any reply...have a nice day :-)!!!

PS:
Code:


//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//INA      DD DSN=Your Input VB 23000 file,DISP=SHR
//INB      DD DSN=Your Input VB 2800 file,DISP=SHR
//SORTOUT  DD DSN=Your Output file,
//            DISP=(,CATLG,DELETE),
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                                       
  OPTION COPY                                                         
  JOINKEYS F1=INA,FIELDS=(23,40,A)                                     
  JOINKEYS F2=INB,FIELDS=(23,40,A)                                     
  JOIN UNPAIRED,F1                                                       
  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                 
//*

Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Oct 29, 2012 11:29 pm
Reply with quote

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.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Tue Oct 30, 2012 10:53 pm
Reply with quote

Hi Bill...super thx for your message icon_biggrin.gif ...I will see, try and check asap..
today I had no chance..have a nice evening..time!!!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top