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

Empty output dataset when using INCLUDE or OMIT COND


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Aug 26, 2008 2:29 pm
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: 218
Location: India

PostPosted: Tue Aug 26, 2008 2:32 pm
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: 1287
Location: Chennai, India

PostPosted: Tue Aug 26, 2008 2:35 pm
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: 8797
Location: Welsh Wales

PostPosted: Tue Aug 26, 2008 2:40 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Aug 26, 2008 2:42 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Aug 26, 2008 2:43 pm
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 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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top