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

Using Count with Include Cond


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

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Wed Jun 03, 2009 4:19 pm
Reply with quote

Hi,

I have a file 621 bytes long with numerous records.

I am looking to find the count of records where position (158,16,LT,0 and 559,16,GT,0) or (158,16,GT,0 and 559,16,LT,0) and write the count to an output file 9 bytes long e.g. 000015489

Both fields are defined as S9(14)v9(2).

Can anyone help?

Thanks
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Wed Jun 03, 2009 5:50 pm
Reply with quote

Michaelod,

Following link might be useful for your requirement.

www.ibmmainframes.com/viewtopic.php?t=40836&highlight=

You can change OMIT COND to INCLUDE COND, OUTREC and TRAILER1 as per your requirement.
Back to top
View user's profile Send private message
Michaelod
Warnings : 1

New User


Joined: 02 Sep 2008
Posts: 49
Location: Edinburgh

PostPosted: Wed Jun 03, 2009 6:12 pm
Reply with quote

I had a look at that thread but it didnt seem to work properly when I tried it.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Jun 03, 2009 9:23 pm
Reply with quote

Hello,

And from that, we're supposed to be able to help. . . icon_sad.gif

Is there any reason you did not post the problem info from your attempt?
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: Wed Jun 03, 2009 10:08 pm
Reply with quote

Michaelod,

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB.

Code:

//S1    EXEC  PGM=SORT                                 
//SYSOUT    DD  SYSOUT=*                               
//SORTIN DD DSN=...  input file (FB)                   
//SORTOUT DD DSN=...  output file (FB/9)                             
//SYSIN    DD    *                                     
  OPTION COPY   
  INCLUDE COND=((158,16,ZD,LT,0,AND,559,16,ZD,GT,0),OR, 
                (158,16,ZD,GT,0,AND,559,16,ZD,LT,0))     
   OUTFIL REMOVECC,NODETAIL,   
     BUILD=(9X),                       
     TRAILER1=(COUNT=(M11,LENGTH=9))                   
/*
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Jun 03, 2009 10:21 pm
Reply with quote

Michaelod wrote:
I am looking to find the count of records where position (158,16,LT,0 and 559,16,GT,0) or (158,16,GT,0 and 559,16,LT,0)
Frank,

Dont we need to add an ",OR, the second condition"?
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: Wed Jun 03, 2009 10:25 pm
Reply with quote

Oh, I missed the second condition. I fixed it above.
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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
Search our Forums:

Back to Top