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
 
Empty output dataset when using INCLUDE or OMIT COND

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

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Tue Aug 26, 2008 2:24 pm    Post subject: Empty output dataset when using INCLUDE or OMIT COND
Reply with quote

Hi,

I am writing a sort function to strip off the Header and trailer of a file. The header starts with a 0 in the first character and the trailer starts with a 9 in the first character. The details records all start with CID as the first 3 char.

I tried writing these 2 conditions, but i am getting only a empty dataset:

1st Condition:
SORT FIELDS=COPY
OMIT COND=(1,1,CH,EQ,C'0',AND,1,1,CH,EQ,C'9')

Second condition:
SORT FIELDS=COPY
INCLUDE COND=(1,3,CH,EQ,C'CID')

I am not sure why i am getting only an empty dataset as output.

When i give HEX on this is what I see:

0 20080825 2
F4FFFFFFFF4F
002008082502
-----------
CID=C006 /O
CCC7CFFF446D
394E30060016
---------
9200808140
FFFFFFFFFF

Does anyone have any suggestion?
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10457
Location: italy

PostPosted: Tue Aug 26, 2008 2:29 pm    Post subject: Reply to: Empty output dataset when using INCLUDE or OMIT CO
Reply with quote

Quote:
OMIT COND=(1,1,CH,EQ,C'0',AND,1,1,CH,EQ,C'9')


not sure about the syntax, but the condition should be an OR
Back to top
View user's profile Send private message
sri_mf

Active User


Joined: 31 Aug 2006
Posts: 215
Location: India

PostPosted: Tue Aug 26, 2008 2:32 pm    Post subject: Reply to: Empty output dataset when using INCLUDE or OMIT CO
Reply with quote

Brindha can you post your JCL ,input data ..RECFM & LRECL..
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Aug 26, 2008 2:35 pm    Post subject: Reply to: Empty output dataset when using INCLUDE or OMIT CO
Reply with quote

Hi,

Quote:
ot sure about the syntax, but the condition should be an OR


It is syntatically correct.

Quote:
Second condition:
SORT FIELDS=COPY
INCLUDE COND=(1,3,CH,EQ,C'CID')


This should fetch you records provided there are records with CID in the first 3 bytes.

Try and post your complete JCL if you face any problem.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

PostPosted: Tue Aug 26, 2008 2:40 pm    Post subject:
Reply with quote

Is the file FB or VB ?

If VB then use
INCLUDE COND=(5,3,CH,EQ,C'CID')
Back to top
View user's profile Send private message
brindha christy

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Tue Aug 26, 2008 2:40 pm    Post subject: Re: Empty output dataset when using INCLUDE or OMIT COND
Reply with quote

When i say OR in the OMIT COND, all the records are copied to the output file.

My JCL is :
Code:

//STEP03    EXEC PGM=SORT
//SORTIN   DD  DSN=XYZ.ABC.CLIST.TEST2,                           
//             DISP=(OLD,KEEP,KEEP)                                     
//SYSIN    DD  *                                                       
  SORT FIELDS=COPY                                                     
  OMIT COND=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'9')                                     
//SORTOUT DD  DSN=XYZ.ABC.CLIST.TEST3,                             
//             DISP=(,CATLG,DELETE),                                   
//             UNIT=SYSDA,                                             
//             SPACE=(CYL,(10,20),RLSE)
//SYSOUT   DD  SYSOUT=*                                       
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

PostPosted: Tue Aug 26, 2008 2:42 pm    Post subject:
Reply with quote

expat wrote:
Is the file FB or VB ?

If VB then use
INCLUDE COND=(5,3,CH,EQ,C'CID')
Back to top
View user's profile Send private message
brindha christy

New User


Joined: 26 Aug 2008
Posts: 20
Location: India

PostPosted: Tue Aug 26, 2008 2:42 pm    Post subject: Re: Empty output dataset when using INCLUDE or OMIT COND
Reply with quote

Yes

SORT FIELDS=COPY
INCLUDE COND=(5,3,CH,EQ,C'CID')

Worked....Thanks for all your help icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10457
Location: italy

PostPosted: Tue Aug 26, 2008 2:43 pm    Post subject: Reply to: Empty output dataset when using INCLUDE or OMIT CO
Reply with quote

Quote:
// DCB=(RECFM=VB,LRECL=1000,BLKSIZE=27998)


since the dataset is VB using the right offset as expat suggested should
yield the expected results in both cases
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 include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts How could i share my personal dataset... James Halley TSO/ISPF 1 Fri Mar 23, 2018 9:41 pm
This topic is locked: you cannot edit posts or make replies. How could i share my personal dataset... samenxia163 TSO/ISPF 1 Fri Mar 09, 2018 12:18 pm
No new posts How to get the output from submit com... Joanna2016 CLIST & REXX 10 Tue Feb 06, 2018 7:26 am
No new posts Where to get sample for processing RM... vice_versa PL/I & Assembler 2 Tue Jan 16, 2018 2:03 pm

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