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
 

 

Confused with FB & VB datasets

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

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Thu May 15, 2008 5:38 pm    Post subject: Confused with FB & VB datasets
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: 200
Location: USA

PostPosted: Thu May 15, 2008 6:20 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 6:22 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu May 15, 2008 6:27 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 6:31 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 6:35 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 6:37 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Thu May 15, 2008 6:42 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 7:01 pm    Post subject:
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 Moderator


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

PostPosted: Thu May 15, 2008 8:57 pm    Post subject:
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: 200
Location: USA

PostPosted: Thu May 15, 2008 10:17 pm    Post subject:
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 Moderator


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

PostPosted: Fri May 16, 2008 1:22 am    Post subject:
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    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 REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts DUMP DATASETS VS TRACE DATASETS! lind sh CICS 4 Tue Dec 06, 2016 11:31 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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