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
 

 

Include cond for VB file.

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

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Sun Sep 30, 2012 12:00 am    Post subject: Include cond for VB file.
Reply with quote

Hi,
I am trying to extract records from a VB file which has different record type. I need to extract the reference number, if the product code is 'xxxx'. The product code is in different position for each record type.

The file has three record types.
If record type is 'A', the reference number starts from 26 and is 5 byte long. The product code starts from 31 and is 4 bytes.
If record type is 'B', the reference number starts from 40 and is 5 byte long. The product code starts from 45 and is 4 bytes.
I need not reffer other record types.

the record type is in position 25 and is 1 byte.
The output should be a FB file and record length should be 9 bytes.

I tried the following sort card, but the include condition does not work properly. If i remove the include condition, i get the formated records for all the records in file. If i have the include condition i get empty file.
Code:
//SYSIN   DD *                                                   
      INREC IFTHEN=(WHEN=(29,1,CH,EQ,C'A'),                   
            OVERLAY=(5:30,9)),                                 
            IFTHEN=(WHEN=(29,1,CH,EQ,C'B'),                                 
            OVERLAY=(5:44,9)),                                 
            IFTHEN=(WHEN=NONE,                                      
            OVERLAY=(5:9C' '))                                 
      SORT FIELDS=(5,9,CH,A)                
   INCLUDE COND=(10,4,CH,EQ,C'xxxx')                                   
      OUTFIL FNAMES=SORTOUT,VTOF,OUTREC=(5,9)

/*

I get the following O/P if i remove the Include condition statement:
(Lrecl=9,Recfm=FB,Dsorg=ps)
refr1xxxx
refr2xxxx
refr3yyyy
refr4zzzz
refr5cccc


If i retain the include condition, i get empty output.

Can anyone let me know what is wrong in the above sort card.

Thanks in advance.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Sep 30, 2012 12:14 am    Post subject:
Reply with quote

Hello,

Did you remember to increase the positions by 4 to allow for the RDW?
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Sun Sep 30, 2012 12:19 am    Post subject: Reply to: Include cond for VB file.
Reply with quote

Yes. I had added +4 bytes, for all the positions.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Sep 30, 2012 12:29 am    Post subject:
Reply with quote

Hello,

Suggest you post a few of the records using HEX ON.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7228

PostPosted: Sun Sep 30, 2012 3:05 am    Post subject: Reply to: Include cond for VB file.
Reply with quote

passion_sujesh,

Have a look at this, which describes DFSort order of processing.

It does not matter where you locate your INCLUDE statement, DFSort will process it where it always does.

So, at the time your INCLUDE was processed, the position/length you are using contained completely different data.

Try with INCLUDE= on OUTFIL instead.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sun Sep 30, 2012 7:35 am    Post subject: Reply to: Include cond for VB file.
Reply with quote

Hi Bill,

Good catch icon_smile.gif

After checking the data, i was going to work thru the code icon_wink.gif

d
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Sun Sep 30, 2012 8:16 am    Post subject: Reply to: Include cond for VB file.
Reply with quote

Thanks bill.
I shall try this and will let you know if it works.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Tue Oct 02, 2012 2:11 am    Post subject: Reply to: Include cond for VB file.
Reply with quote

Thanks Bill.
I used include in OUTFIL, and it works fine. :-)
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 02, 2012 7:17 pm    Post subject: Reply to: Include cond for VB file.
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 02, 2012 10:06 pm    Post subject:
Reply with quote

A better approach would be to filter the records with an INCLUDE cond and build only required fields.

Code:

//SYSIN    DD *                                             
  OPTION VLSCMP,VLSHRT                                       
  INCLUDE COND=((29,1,CH,EQ,C'A',AND,35,4,CH,EQ,C'XXXX'),OR,
                (29,1,CH,EQ,C'B',AND,49,4,CH,EQ,C'XXXX'))   
                                                             
  INREC IFTHEN=(WHEN=(29,1,CH,EQ,C'A'),BUILD=(1,4,30,9)),   
        IFTHEN=(WHEN=(29,1,CH,EQ,C'B'),BUILD=(1,4,44,9))     
                                                             
  SORT FIELDS=(5,9,CH,A)                                     
  OUTFIL VTOF,BUILD=(5,9)                                   
//*
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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