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

OMIT other unsatisfied records in OUTREC, OUTFIL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Thu Jan 08, 2015 1:33 pm
Reply with quote

I am including the records satisfying the condition in IFTHEN as in below attachment

Now I need to OMIT the rest of the records. How can I do that?

Please suggest.

TIA
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 08, 2015 3:20 pm
Reply with quote

Please copy/paste code from your emulator, do not post images.

You just need to have an INCLUDE COND= for the conditions you have with the IFTHENs.
Back to top
View user's profile Send private message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Thu Jan 08, 2015 3:51 pm
Reply with quote

Sure Bill Woodger. Going forward I will copy as per your suggestion.
Thank you for your reply. Its working now.

Also in the BUILD, since I am using the code as
BUILD=(1:1,4,5:1214,18)

since my input is VB, and output is FB, so as no to miss the RDW.
My record is starting from 5th character and first 4 bytes are empty.

How can I get records which start from 1 and also should not miss RDW ?

TIA
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jan 08, 2015 4:34 pm
Reply with quote

Code:
BUILD=(5,43) or BUILD=(5,39)


When you CONVERT to fixed-length, you BUILD to the fixed-length you want to see on the output, but based on the variable-length of your input to the BUILD. Basically, adjust everything by four to ignore the RDW. Depending how you've calculated 43 already, that may not need to change.
Back to top
View user's profile Send private message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Thu Jan 08, 2015 6:03 pm
Reply with quote

Its working as per my expected result.

Thank you very much Mr. Bill....
Back to top
View user's profile Send private message
tvinodkumar7

New User


Joined: 06 Jan 2015
Posts: 19
Location: Hyderabad, INDIA

PostPosted: Fri Jan 09, 2015 10:56 am
Reply with quote

Now as part of performance tuning,
since if I use OUTREC, we may require more memory for intermediate file.

Hence I planned to use the OUTFIL directly instead of OUTREC as below

Code:
    SORT FIELDS=COPY                                                   
    OUTFIL IFTHEN=(WHEN=((204,3,CH,EQ,C'010',OR,204,3,CH,EQ,C'019'),AND,
                        (206,7,FS,EQ,NUM)),                             
                   BUILD=(1:204,2,3:C'000000000',                       
                          12:206,7,19:39,05,PD,TO=ZD,LENGTH=09,         
                          28:44,07)),                                   
           IFTHEN=(WHEN=(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'),     
                   BUILD=(1:328,18,19:39,05,PD,TO=ZD,LENGTH=09,         
                          28:44,07))
INCLUDE COND=((206,7,FS,EQ,NUM),OR,                     
              (328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'))


also my input file is 3025 and the required output should have 34 length.

If I give 3025 LRECL in the output file, it is successful, else I am getting the below error

Code:
3025 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 34 BYTE LRECL FOR SORTOUT


Please suggest.

TIA.

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jan 09, 2015 3:29 pm
Reply with quote

DFSORT is designed to do things quickly. There is no way that it correlates your INCLUDE to your processing, so it is unaware that every remaining input record has a BUILD processed for it. You need to use IFOUTLEN which sets the length of the record after the IFTHEN processing has finished.

In a COPY it is not going to make any difference for performance between the INREC, OUTREC and OUTFIL. I still use INREC to "cut it down early". Obviously the impact is when there is a SORT, as reducing the record size before the data is sorted, reduces the amount of data that is tossed around.

Don't specify any DCB information (RECFM or LRECL) on the DD for the output file(s). It means there are two places to maintain the data. SORT will set up everything correctly, which with your example would be the long value, but would change when you make the change to the Control Cards.

Code:
 INCLUDE COND=((206,7,FS,EQ,NUM),OR,                     
              (328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'))

   INREC IFOUTLEN=34,
        IFTHEN=(WHEN=((204,3,CH,EQ,C'010',OR,204,3,CH,EQ,C'019'),AND,
                        (206,7,FS,EQ,NUM)),                             
                   BUILD=(1:204,2,3:C'000000000',                       
                          12:206,7,19:39,05,PD,TO=ZD,LENGTH=09,         
                          28:44,07)),                                   
           IFTHEN=(WHEN=(328,3,CH,EQ,C'010',OR,328,3,CH,EQ,C'019'),     
                   BUILD=(1:328,18,19:39,05,PD,TO=ZD,LENGTH=09,         
                          28:44,07))
    SORT FIELDS=COPY         
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
Search our Forums:

Back to Top