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: 10327
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: 8593
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: 8593
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: 10327
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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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