Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using Count with Include Cond

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Using Count with Include Cond
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: 356
Location: New York

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

Michaelod,

Following link might be useful for your requirement.

http://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    Post subject: Reply to: Using Count with Include Cond
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

Site Director


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

PostPosted: Wed Jun 03, 2009 9:23 pm    Post subject:
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 Moderator


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

PostPosted: Wed Jun 03, 2009 10:08 pm    Post subject:
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: 2285
Location: @my desk

PostPosted: Wed Jun 03, 2009 10:21 pm    Post subject:
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 Moderator


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

PostPosted: Wed Jun 03, 2009 10:25 pm    Post subject:
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts More than 1 Include criteria for sing... Roy Ware SYNCSORT 6 Wed Sep 13, 2017 11:45 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us