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

SORT -JOINKEY to get Header and Trailer apart from MATCHING


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

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Wed Aug 11, 2010 12:13 pm
Reply with quote

Hi All,

Hope every one doing good...

i faced one complexity as below :--

First : Input file contain Header/Detail/Trail records..it means start
with (11/00/99).
Second : Input file contain Normal records..without Header/Detail/Trailer.

As per the SORT JOIN KEY.....we can get the matching records present in both the files...

1) But the Header & Trailer records not having comparison field,so in this
case these two records that is HEADER & TRAILER records will be
excluded.

is there any way to get those reocrds in o/p file as well...bcz this file
will be using in some other appliation too..

2) First input file is Fixed length.....this is not an issue.
2nd input file is Variable file......current maximum length is 1696...but
it can be diffrent next time.....importent thing is we are intrested entire
lenth of the reocrd.

3) How the O/p file length we need to specify if its creating new
1) can we referback the DCB & SPACE parameter of 2nd input file.


4) Input file may be having Hudgge records....to avoid SB37 abend for
O/P file creation what are precaution needs to be considerd apart from
maximum space..SORTWORK FILE...etc.

please provide u r suggestion/advise on the Point 1 ,2 and 4.

Thanks

Prem
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Wed Aug 11, 2010 1:44 pm
Reply with quote

would you mind pasting the input data sample too ?
Back to top
View user's profile Send private message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Wed Aug 11, 2010 7:08 pm
Reply with quote

Please see as below :--

11xyzrueuerure
00fdjdkdkdkdkd
00fkdkdkdkdkdk
00dkdkdkdkdkdk
99eueueueueueu

as we are looking for the matching of File-1 position(columns) 10:8
with File-2 Positions(columns) 70:8

2nd Input file contain Header/D/T which is Variable length file...in above by mistake i have mentioned first file..its a 2nd file and we are intrested to take the records from this file only i.e 2nd input file.
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 11, 2010 8:43 pm
Reply with quote

prem_ibm,

The following DFSORT JCL will give you the desired results. I assumed that your VB file also have header and trailer in pos 5 ( after 4 byte rdw). The matching key in VB file is at 70 (considering the RDW)

Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//FBFILE   DD DSN=your input fb file with key at pos 10,DISP=SHR
//VBFILE   DD DSN=your input vb file with key at pos 70,DISP=SHR
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                       
  OPTION COPY                                         
  JOINKEYS F1=FBFILE,FIELDS=(1,2,A,10,8,A)             
  JOINKEYS F2=VBFILE,FIELDS=(5,2,A,07,8,A)             
  JOIN UNPAIRED                                       
  REFORMAT FIELDS=(F2:1,4,?,F2:15)                     
  OUTFIL INCLUDE=(5,1,CH,EQ,C'B'),BUILD=(1,4,6)       
//JNF1CNTL DD *                                       
  INREC IFTHEN=(WHEN=(1,2,CH,EQ,C'11'),OVERLAY=(1:2X))
//JNF2CNTL DD *                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5,2,70,8,5)),     
  IFTHEN=(WHEN=(15,2,CH,EQ,C'11'),OVERLAY=(5:2X))     
//*
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

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top