Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT -JOINKEY to get Header and Trailer apart from MATCHING

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT -JOINKEY to get Header and Trailer apart from MATCHING
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    Post subject:
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    Post subject: Reply to: SORT -JOINKEY to get Header and Trailer apart fro
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    Post subject:
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    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
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us