Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Join to VB files and update certain adresses of F1 by F2
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Jul 26, 2012 8:25 pm    Post subject: Join to VB files and update certain adresses of F1 by F2
Reply with quote

Hi everyone,
Can please somebody help and provide the DFSORT/JCL-Code for following requirement (joinkeys, reformat, overlay)…would be great:

There are two input files:

F1 RECFM=VB, LRECL=23000
F2 RECFM=VB, LRECL=2800

Both files have different structure but joinkey is for both file at 23,40 (23 included the 4 Byte RDW).

Files may not contain duplicate keys.

The task is:

For all matching records replace at different addresses at F1 25 byte from different addresses from F2.
(all char)

For example:

replace 100,25 from F2 at 200,25 in F1
replace 150,25 from F2 at 250,25 in F1

and so on…after the job the output records of F1 are changed on and from the involved addresses.
(I’m working with GDG’s so let’s assume…output is a new GDG of F1 or a different Filename…doesn’t matter for my needed solution example)

If some of the keys/records are present only in F1, we want keep all records like that untouched in the output file F1.
(Input files are not sorted so the joinkeys default sort should be done etc (means no parameter sorted..)

PS: I wrote “Files may not contain duplicate keys.” …would be nice if you tell me additional what to add if that’s not the case…
PS2: I pre checked the forum posts but couldn’t find an valid example…most are FB or different at all….

Super thx in advance for any help!!!
Bye, have a nice time everyone!!
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 26, 2012 8:40 pm    Post subject:
Reply with quote

Quote:
PS2: I pre checked the forum posts but couldn’t find an valid example…most are FB or different at all….

that means all the examples I found would require me to think in order to use them.
I just want you to provide the coded control cards for my problem.

Quote:

Super thx in advance for any help!!!
Bye, have a nice time everyone!!


It's time for me to go home,
so don't expect any clarification of the requirement.
i expect to find the solution in the morning.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jul 26, 2012 8:43 pm    Post subject: Reply to: Join to VB files and update certain adresses of F1
Reply with quote

The only real difference between an FB joinkeys and a VB joinkeys is that you have to be careful about the "variable" bits.

You need your entire F1 record. You only need certain fields from the F2.

(F1:1,4,F2:allthefieldsyouneed,?,F1:5)

The REFORMAT record is going to be variable, so needs to start with an RDW which is going to be adjusted as it goes along. So here, F1:1,4 . Then the "fixed" fields from F2 that you need. Then the match marker (the ?) then the entire F1 variable record, excluding the RDW. The F1:5 will copy from 5 to the end of the F1 record.

If any of the fields for replacement are in the actual variable part of the F1, you'll need to make those conditional. Otherwise, from the REFORMAT record example above, I think you'll get there.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Jul 26, 2012 9:22 pm    Post subject:
Reply with quote

Hello Mr. Brenholtz,

that's really not fair and really not true...this was my first post...
I was motivated to the so often super help given to others by for example Frank Y or skolusu ....but anyway thanks for the reply even if that was a
not very nice assumption..

Have a nice time everyone!!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 26, 2012 9:34 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Quote:
that's really not fair and really not true...
Some of us "old guys" get testy at times. . . .

If you post a bit of representative sample input and the output you want whan the sample data is processes, someone may be better able to help.

Creating test data that is less than 80 chars makes for much easier testing icon_smile.gif
The width can be changed later for the real data. Also, please use the Code tag to preserve alignment of the data posted.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jul 26, 2012 9:45 pm    Post subject:
Reply with quote

I apologize,
i was wrong,
you obviously had not gone home.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Jul 26, 2012 10:06 pm    Post subject:
Reply with quote

Hi and super thx to all of you...it's ok Dick...no problem at all...

I can imagine that all those questions are sometimes really annoying....
But I'm honestly not that familiar with that ...I' working on it...this is one step of it....thanks in advance for further help..

Relatet to my first post an example of data (short for the example):

F1:
Code:
0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789
0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789
0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789ABCDEFGHIJ0123456789
F2:
Code:
xxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyzzzzzzzzzzzzzzzzzzzz
xxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyzzzzzzzzzzzzzzzzzzzz
xxxxxxxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyzzzzzzzzzzzzzzzzzzzz

new F1:
Code:
0123456789ABCDEFGHIJ01234yyyyyyyyyyyyyyyyyyyyyyyyyABCDEFGHIJ0123456789
0123456789ABCDEFGHIJ01234yyyyyyyyyyyyyyyyyyyyyyyyyABCDEFGHIJ0123456789
0123456789ABCDEFGHIJ01234yyyyyyyyyyyyyyyyyyyyyyyyyABCDEFGHIJ0123456789

What I don't get / understand is the needed syntax for 1-n replacements of the data in VB file F1....do i need overlay statement etc..

Thx!!!!
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1738
Location: Bloomington, IL

PostPosted: Thu Jul 26, 2012 10:15 pm    Post subject:
Reply with quote

wabasaja wrote:
I was motivated to the so often super help given to others by for example Frank Y or skolusu ....[/b]

Mr. Yaeger (who has now retired) was and Kolusu is a DFSORT developer, for which reason they did and will give people complete sort control decks and JCL. The rest of us lack this motivation; we will answer questions and offer suggestions and even code fragments, but seldom write entire programs for querents (save that we are offered our usual billing rates, on the close order of Rs. 50,000/day).
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 26, 2012 10:18 pm    Post subject:
Reply with quote

Hello,

I don't understand the 1-n reference. . .

Is there no key upon which these files can be matched? Is ther a way to ensure that both files have the same number of records?

To get the output you want, you could use BUILD (and OVERLAY?) to format the new output recorde.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Jul 26, 2012 10:24 pm    Post subject:
Reply with quote

Hi Akatsukami,

I understand...but like I wrote...I was motivated by the posts
of Mr. Yaeger (I wish him a very nice and long long lasting retirement)
and Kolusu....hope there is an new Member for Frank ;-)....and thanks god...there is still Kolusu ;-)...anyway ...super thx for any help from anybody!! Great great forum!!!

Thx2all!!!
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Thu Jul 26, 2012 10:30 pm    Post subject:
Reply with quote

Hi dick scherrer,

please check my first post..I wrote:
.."Both files have different structure but joinkey is for both file at 23,40 (23 included the 4 Byte RDW). .."

So the answer is ...yes...keys for matching let's say by joinkeys are available...

That: the 1-n reference. . .was related to the fact that I must change data at F1 at 1-n places....adresses...e.g. 50,25...150,25...500,25

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Jul 26, 2012 10:53 pm    Post subject: Reply to: Join to VB files and update certain adresses of F1
Reply with quote

And whilst all this is going on did you actually look at the REFORMAT I showed?

You'll need BUILD, not OVERLAY, due to the position of the variable portion.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jul 26, 2012 11:06 pm    Post subject:
Reply with quote

wabasaja,

Use the following DFSORT JCL which will give you the desired results
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                                                       
  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
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Jul 26, 2012 11:24 pm    Post subject:
Reply with quote

Hello,

Good to see the complete solution from Kolusu icon_smile.gif

Quote:
please check my first post..I wrote:
.."Both files have different structure but joinkey is for both file at 23,40 (23 included the 4 Byte RDW). .."
Then you should have shown this in the sample data. . . The bunches of x, y, z gave no hint that there was a key in that data.

You will get far more usable replies far quicker if you post proper detail people can use to help you. Sample data should follow the written "rules" even if they have to be customized for the topic.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Fri Jul 27, 2012 3:50 am    Post subject: Reply to: Join to VB files and update certain adresses of F1
Reply with quote

Hello all,

after a 12 hours working day I finally left the office ;-)...but still time left
to say thanks again to all of you....and for sure I have read every word...thx
And...wow...I had luck...Skolusu you gave me all ...so as soon I'm back at the office....I try .....have a nice time everyone!!!
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Fri Jul 27, 2012 9:43 pm    Post subject:
Reply with quote

Hi all, hi Skolusu,

I couldn't try it today due to other constraints…I will do it asap…on Monday or Tuesday.
Anyway I give a feedback and another Thx!!!

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

Senior Member


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

PostPosted: Fri Jul 27, 2012 11:16 pm    Post subject:
Reply with quote

wabasaja,

It is a welcome change to see someone posting a feedback. Most of the time in here it is just "Here do my work and come back only when I need more work to be done"

btw I have a minor change in the control cards I provided.

change this statement to
Code:
  JOIN UNPAIRED         
to
Code:
  JOIN UNPAIRED,F1
so that you only pick the matched and unmatched records from F1.
Back to top
View user's profile Send private message
wabasaja

New User


Joined: 25 Jul 2012
Posts: 14
Location: germany

PostPosted: Tue Jul 31, 2012 10:21 pm    Post subject: Reply to: Join to VB files and update certain adresses of F1
Reply with quote

Hi Skolusu,

Thx again!!
If somebody helps as you do or earlier Frank did….
wow…it should be a matter of course that you receive always a great super thanks…and for sure an adequate feedback…

for me it’s normal without saying...
I’m glad that someone like you and all helping members exists!!!
But I have to admit that I still need one more day before I try…
But just by looking to the offered solution..I see that I have no clue about the build statement related to….
how is decided and marked respectively how knows DFSORT which part of the record comes from F1 and which from F2..…
I guess it’s a fixed rule like…rdw (if VB)…then F1, F2,F1, F2,F1….or??

Ok…I see all knowing people…experts laugh icon_wink.gif

Have a nice time Skoluso and for sure also all members of the board!!!

I come back asap ..hopefully tomorrow..Bye
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 31, 2012 10:37 pm    Post subject:
Reply with quote

wabasaja,

It is not a fixed rule. Look at the reformat statement

Code:

  REFORMAT FIELDS=(F1:1,4,       $ RDW                           
                   ?,            $ INDICATOR                     
                   F2:5,2796,    $ COPY FILE2 FULL 2796 BYTES   
                   F1:5)         $ COPY VARIABLE FILE1 REC       


? indicates a 1-byte indicator is to be included in each joined record. The indicator will be set to one of the following values in each paired or unpaired joined record, as appropriate:

Code:

    'B' - the key was found in F1 and F2.

    '1' - the key was found in F1, but not in F2.

    '2' - the key was found in F2, but not in F1.


Read about the REFORMAT statement here

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.5?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Jul 31, 2012 11:15 pm    Post subject:
Reply with quote

Hello,

Quote:
Ok…I see all knowing people…experts laugh
Even the experts had to learn once upon a time and will not laugh. Most just want to help if possible.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us