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

Confused with FB & VB datasets


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 5:38 pm
Reply with quote

Hi,

I have a requirement like I need to write out records from file B when there is match of fields in fileA.
The fields in FILE A start from 18 and length is 3 and RECFM=FB
The fields in FILE B start from 2 and length is 3 and RECFM=VB.for this VB file I didnt include RDW.If you inlcude it then it will be from 6 and length is 3.

So when we geta match then we need to include all the records from FILEB. So the output file should also be VB.FILEB may contain duplicate keys. But I need to include those duplicate records also from FILEB so I used withall.

Currently I am using the following JCL.

Code:

//IN1  DD DSN=file A
//IN2  DD DSN=file B
//T1   DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(200,100),RLSE),
//        DCB=(RECFM=VB,LRECL=4250,BLKSIZE=0)                 
//OUT  DD DSN=output file
//TOOLIN DD *                                                 
  COPY FROM(IN1) USING(CTL1)                                 
  COPY FROM(IN2) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(4197,3,CH) -                     
  WITH(5,4187) WITHALL USING(CTL3)                           
/*                                                           
//CTL1CNTL DD *                                               
    OUTFIL OVERLAY=(4193:18,3),FNAMES=T1,FTOV                 
/*                                                           
//CTL2CNTL DD *                                               
    OUTFIL OVERLAY=(4193:06,3),FNAMES=T1                     
/*                                                           
//CTL3CNTL DD *                                               
    OUTFIL FNAMES=OUT,BUILD=(5,4187)                       
/*                                                           


But I am getting error. So please help in this case

Code:
ICE126A 9 INCONSISTENT OUT      IFTHEN 0 REFORMATTING FIELD FOUND


Regards
Amar[/b]
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 6:20 pm
Reply with quote

Sorry I forgot to post the record lengths.

FILEA-- FB,200
FILEB--VB,4191

OUT should be ---VB,4191 as I want to extract the records from FILEB
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 6:22 pm
Reply with quote

Now I have chnaged the card as follows. Then it gave me return code zero.

Code:

//T1   DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(200,100),RLSE),
//        DCB=(RECFM=VB,LRECL=4199,BLKSIZE=0)                 
//OUT  DD DSN=NMXT.APOG120.EIPL.MATCH,DISP=OLD               
//TOOLIN DD *                                                 
  COPY FROM(IN1) USING(CTL1)                                 
  COPY FROM(IN2) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(4193,3,CH) -                     
  WITH(1,4187) WITHALL USING(CTL3)                           
/*                                                           
//CTL1CNTL DD *                                               
    OUTFIL BUILD=(1:1,200,3992X,18,3),FNAMES=T1,FTOV         
/*                                                           
//CTL2CNTL DD *                                               
    OUTFIL OVERLAY=(4193:06,3),FNAMES=T1                     
/*                                                           
//CTL3CNTL DD *                                               
    OUTFIL FNAMES=OUT,BUILD=(1,4187)                         
/*                                                           


I hope that should be correct.

Please let me know if there are any discrepancies in the above code.


Regards
Amar
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 15, 2008 6:27 pm
Reply with quote

I don't know, but don't you need to include the RDW in the OUTFIL FNAMES=OUT,BUILD=(5,4187) statement?
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 6:31 pm
Reply with quote

That is why I confused and so I posted this thread.But now I got return code as zero but it is including the records from both FILE A and FILE B.

I am still working on that.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 6:35 pm
Reply with quote

If you are right, then I need to change the on fields also right??

So I changed the card as below now.

Code:

//TOOLIN DD *                                       
  COPY FROM(IN1) USING(CTL1)                       
  COPY FROM(IN2) USING(CTL2)                       
  SPLICE FROM(T1) TO(OUT) ON(4197,3,CH) -           
  WITH(5,4187) WITHALL USING(CTL3)                 
/*                                                 
//CTL1CNTL DD *                                     
    OUTFIL BUILD=(1:1,200,3992X,18,3),FNAMES=T1,FTOV
/*                                                 
//CTL2CNTL DD *                                     
    OUTFIL OVERLAY=(4193:06,3),FNAMES=T1           
/*                                                 
//CTL3CNTL DD *                                     
    OUTFIL FNAMES=OUT,BUILD=(5,4187)               
/*                                                 



need to check....

Regards
Amar
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 6:37 pm
Reply with quote

But got the same error repeated again... icon_sad.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu May 15, 2008 6:42 pm
Reply with quote

You fixed the OUTFIL while I was off looking up the error......

I'm confused too, after the match (?) in the splice, how can you tell which record is from which original file? Don't you need add an identifier in the CTL1 & 2 and then test for in in CTL3?
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 7:01 pm
Reply with quote

Let's wait and see what Frank or Skolusu says....
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: Thu May 15, 2008 8:57 pm
Reply with quote

Frank says:

Start over and show a good example of the records in each input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of each input file and the RECFM and LRECL you want for the output file. Give the starting position, length and format of each relevant field (for the VB file include the RDW when you give the starting positions). If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Thu May 15, 2008 10:17 pm
Reply with quote

Frank,

My requirement is to write out records from file B when there is match of particular fields against fileA.


File A---> RECFM=FB and LRECL=200 contains the following records

Code:

----+----1----+----2----+----3----+----4----+----5----+----
M  6F3   32010F4208              DOM          ..                #
M  6F3   32010F4209              DOM          ..                #
M  EO2   10101B10G1            DOM          ..                #
M  KH1   10001EL01A             DOM          ..                #
M  8H1   10001EL01A             DOM          ..                #


File B-----> RECFM=VB and LRECL=4191 contains the following records

Code:

M208   1000110101B10G1      01910115      61
MEO2   11010009331281A      01970501      62
M209   11010009331301A      08970501      62
M10G   11010009331351A      01970501      62


So now when in File A position (18,3,CH) and File B position (6,3,CH) matches then I need to write the FILEB record to output file.One more thing is I need the output order of the records should be as same as they exist in FILEB.Here in file B is 6 is relative position actually in the file it exists in 2nd position.

regards
Amar
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: Fri May 16, 2008 1:22 am
Reply with quote

You're getting closer but what about this:

Quote:
If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example.


You said previously that fileB can have duplicate keys but your example seems to have duplicates in fileA but not in fileB. Which file or files can really have duplicates?

Quote:
what you expect for output


You didn't show what you expect for output.

I don't have time for guessing games so please give me all of the information I asked for. Show an example with duplicates in one or both input files as appropriate and show the expected output.
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 Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
No new posts define 1 DCB parms for multiple outpu... JCL & VSAM 9
No new posts FTP datasets to server CLIST & REXX 13
Search our Forums:

Back to Top