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

sort: comapare VB files with FB file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Mon Oct 13, 2008 9:20 pm
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
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 Developer


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

PostPosted: Tue Oct 14, 2008 11:40 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top