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
 

 

Need to overlay only one field of 2 byte length from FILE A

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
RAJA-RAJA

New User


Joined: 11 Sep 2009
Posts: 10
Location: chennai

PostPosted: Fri Mar 23, 2012 2:19 pm    Post subject: Need to overlay only one field of 2 byte length from FILE A
Reply with quote

I have 2 FILES and I need to overlay only one field of 2 byte length from FILE A to FILE B under some IF (KEY) conditions.

My FILE A has RECFM as FB and LRECL as 104. My FILE B has RECFM as FB and LRECL as 210. My Output file also has RECFM as FB and LRECL as 210.

My FILE A has keys starting from position 41 to a length of 28 bytes. So the end position is 68 in my FILE A.
My FILE B has keys starting from position 30 to a length of 28 bytes. So the end position is 57 in my FILE B.

I want to compare the KEYS from FILE A to FILE B. My FILE A will have unique records whereas the FILE B has duplicate keys. So I want to overlay all the duplicates in FILE B. There are also chances where the records present in FILE A need not be present in FILE B, So we need not worry about those. We need to consider only if there is any matching records for the keys from both FILE A and FILE B, then we need to take the record in position 37 to 38 (Length of 2 byte) from FILE A and need to overlay in FILE B in position 209 to 210 (Length of 2 byte). I also need the unmatched records from only FILE B to Output. Please find the sample example below

Say for ex:

FILE A

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX11XXEEEEEEEEEEEEEEEEEEEEEEEEEEEEXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22XXFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX33XXKKKKKKKKKKKKKKKKKKKKKKKKKKKKXXXXXXXXXXXXXXXXXXXX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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXGH
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Mar 23, 2012 2:31 pm    Post subject: Reply to: Need to overlay only one field of 2 byte length fr
Reply with quote

Five topics, six posts. Not the best of communicators?

Search the forum for JOINKYES examples. Hit the docs.
Back to top
View user's profile Send private message
RAJA-RAJA

New User


Joined: 11 Sep 2009
Posts: 10
Location: chennai

PostPosted: Fri Mar 23, 2012 4:17 pm    Post subject:
Reply with quote

Sorry I couldnt get the correct docs. Could you please help me on this?
Back to top
View user's profile Send private message
RAJA-RAJA

New User


Joined: 11 Sep 2009
Posts: 10
Location: chennai

PostPosted: Fri Mar 23, 2012 6:24 pm    Post subject:
Reply with quote

In the above requirements please add the following as well. In FILE A, I have only 700 records whereas the in FILE B i have 32000. I want to match each key present in FILE A to all the 32000 records present in FILE B and whereever the match found. We need to overlay with the 2 byte field from FILE A (position 37 - 38) to FILE B (Position 209 - 210).
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Mar 23, 2012 7:01 pm    Post subject:
Reply with quote

RAJA-RAJA wrote:
Sorry I couldnt get the correct docs. Could you please help me on this?


There is a link to IBM manuals at the top of the page, and look at the Stickys in the DFSORT forum.

You could provide your DFSORT level. There is a Sticky which describes how.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Fri Mar 23, 2012 9:29 pm    Post subject:
Reply with quote

Hi,

Below mentioned sort card will work for your requirement.

Code:
//STEP01  EXEC PGM=SORT                                                 
//SYSPRINT  DD SYSOUT=*                                                 
//SYSOUT    DD SYSOUT=*                                                 
//INPUT1    DD *                                                       
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX11XXEEEEEEEEEEEEEEEEEEEEEEEEEEEEXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX22XXFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX33XXKKKKKKKKKKKKKKKKKKKKKKKKKKKKXXXXXXXXXXXXXXXXXXXXXXX
/*                                                                     
//INPUT2    DD *                                                       
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXBA
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXAB
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXCD
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXEF
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXGH
/*                                                                     
//SORTOUT  DD  DSN=<Output File Name>,                           
//             DISP=(NEW,CATLG,DELETE),                                 
//             UNIT=(SYSDA,9),SPACE=(CYL,(25,50),RLSE),                 
//             DCB=(RECFM=FB,LRECL=210)                                 
//SYSIN  DD  *                                                         
   JOINKEYS F1=INPUT1,FIELDS=(41,28,A)                                 
   JOINKEYS F2=INPUT2,FIELDS=(30,28,A)           
   JOIN UNPAIRED,F2                             
   REFORMAT FIELDS=(F2:1,210,?,F1:37,2)           
   SORT FIELDS=COPY                             
   OUTREC IFTHEN=(WHEN=(211,1,CH,EQ,C'B'),       
          BUILD=(1:1,208,209:212,2)),         
          IFTHEN=(WHEN=(211,1,CH,EQ,C'2'),       
          BUILD=(1:1,210))                   
/*                                               




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

Senior Member


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

PostPosted: Fri Mar 23, 2012 9:53 pm    Post subject:
Reply with quote

Raja-Raja,

Use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//INA      DD DSN=Your duplicate file of lrecl 210,DISP=SHR
//INB      DD DSN=Your unique file of lrecl 104,DISP=SHR
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                           
  OPTION COPY                             
  JOINKEYS F1=INA,FIELDS=(30,28,A)       
  JOINKEYS F2=INB,FIELDS=(41,28,A)       
  REFORMAT FIELDS=(F1:1,208,F2:37,2)     
//*
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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