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
 

 

sort: comapare VB files with FB file

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

New User


Joined: 23 Dec 2005
Posts: 19
Location: Bangalore

PostPosted: Mon Oct 13, 2008 8:58 pm    Post subject: sort: comapare VB files with FB file
Reply with quote

Input1- rec length - 808(VB) fields are ACC-ID = start=05 length =11 and ACC-CODE= start=17 length =03
Input3 - rec length - 2782(FB) ACC-ID = start=05 length =11 and
ACC-CODE = start=17 length =03

My question is i need to compare input1 with input2 for above fields and write into out file?
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Oct 13, 2008 9:20 pm    Post subject:
Reply with quote

You need to show an example of your input records and what you expect for output. "Compare ... and write into out file " does not adquately tell us what you want to do. Write what into the output file? Records from input1 that match input2? Records from input2 that match input1? Records from input1 and input2 that match?

If input1 can have duplicates within it, show that in your example. If input2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
aru_bec

New User


Joined: 23 Dec 2005
Posts: 19
Location: Bangalore

PostPosted: Tue Oct 14, 2008 11:12 pm    Post subject:
Reply with quote

Apologies for not providing the details.

I am reframing my problem -

Input File 1 : rec length - 604 (VB) fields are ACC-ID = start=05 length =5 and RECORDTYPE= start=12 length =01
Input File 2 : rec length - 200(FB) ACC-ID = start=01 length =05

Output file : rec length - 404 (FB) fields are ACC-ID = start=05 length =5


The ouput file should contain records from Input File 1 with record type 'C' for all the Account Ids present in Input File 2


Code:

Input File 1: Duplicates exist but record type different

ACCTID RECTYPE FILLER

(5-9) (10) (11-600)
-----------------------
00001A************
00001B*********************************
00001C****
00001D***********************
00002A************
00002B*********************************
00002C****
00003A************
00003C****
00004A************
00004B*********************************
00004C****
00004D***********************
00005A************
00005B*********************************
00005C****
00005D***********************
00005E
00006A************
00006C****
00007A************
00007C****
00007E*******************************************
00008A************
00008C****
00009A************
00009C****
00010A************
00010C****
00010D***********************
00011A************
00011C****


Input File 2: Duplicates possible

ACCTID

(1-5)
-----------------------
00001
00003
00006
00008
00010
00005
00006

Output File: Should not contain duplicates

ACCTID Filler
(1-5) (5-404)
------------------------
00001C****
00003C****
00005C****
00006C****
00008C****
00010C****



Please guide me to solve this using a single sort step.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Oct 14, 2008 11:40 pm    Post subject:
Reply with quote

I think I get the idea, but some of your details aren't consistent, so I'm going to have to make some assumptions.

For File1, you say RECORDTYPE= start=12 length =01, but in the example of the File1 records, the RECORDTYPE appears to be in position 10, not in position 12. I'll assume it's in position 10.

For the output file, you show 1-5 and then 5-404, so there's an overlap. I'm going to assume that you want the output records to have the
5-byte ACC-ID in positions 1-5, the 1-byte RECORDTYPE in position 6, and *s for the rest of the record.

Given those assumptions, here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (VB/604)
//IN2 DD DSN=...  input file2 (FB/200)
//IN2 DD DSN=&&I2,DISP=(OLD,PASS)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/404)
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,5,CH) FIRSTDUP USING(CTL3)
/*
//CTL1CNTL DD *
  INCLUDE COND=(10,1,CH,EQ,C'C')
  OUTFIL FNAMES=T1,VTOF,BUILD=(5,6)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,5,X)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,OMIT=(6,1,CH,EQ,C' '),
    OVERLAY=(7:398C'*')
/*
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 Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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