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

Problems with OUTFIL/OMIT


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

New User


Joined: 08 Jan 2009
Posts: 3
Location: India

PostPosted: Thu Jan 08, 2009 9:39 pm
Reply with quote

Hi,

I'm using the following card.

Code:
OUTFIL FILES=1                             
SORT FIELDS=(11,2,PD0,A)                   
OUTFIL FILES=2,INCLUDE=(168,2,BI,EQ,X'011C')
OUTFIL FILES=3,OMIT=(24,1,CH,EQ,C'T',OR,24,1,CH,EQ,C'O',OR,
                        24,1,CH,EQ,C'R',OR,24,1,CH,EQ,C'G')
SORT FIELDS=(168,2,PD,A,42,2,PD,A,15,9,PD,A)


My output is File3. It's required that this file gives me the o/p after omitting records from & then sorting the i/p file.

Is there a syntax problem? Please advise.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jan 08, 2009 9:48 pm
Reply with quote

Arunav wrote:
Is there a syntax problem?
Is there a syntax problem? What does your sysout show?
Two SORT statements?
Back to top
View user's profile Send private message
Arunav

New User


Joined: 08 Jan 2009
Posts: 3
Location: India

PostPosted: Thu Jan 08, 2009 9:57 pm
Reply with quote

Hi,

Thanks for the swift reply!

My output from File3 shows records omitted correctly from the OMIT statement but the below SORT statement doesn't seem to get a hit.

SORT FIELDS=(168,2,PD,A,42,2,PD,A,15,9,PD,A)

Is it because the file has already been sorted for File1 & the OUTFIL for File3 is taking that as input? Can we use multiple SORTs while involving OUTFIL control statement?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Jan 08, 2009 10:08 pm
Reply with quote

I do believe that one is all you are allowed.....
Each type of program control statement can appear only once within a single source (for example, the SYSIN data set).
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: Thu Jan 08, 2009 10:23 pm
Reply with quote

Arunav,

You can only have one SORT statement per DFSORT run. Your first SORT statement is used and your second SORT statement is ignored.

SORT is processed before OUTFIL, so your records are sorted by 11,2,PD0,A and then those sorted records are processed by your three OUTFIL statements.


Quote:
It's required that this file gives me the o/p after omitting records from & then sorting the i/p file.


If you want to omit records before sorting, then you have to use an OMIT statement, not an OMIT operand on OUTFIL. The OMIT statement is processed before the SORT statement. OUTFIL (and OUTFIL OMIT) is processed after the SORT statement. Note that an OMIT statement would affect all of the OUTFIL output files.

See this Figure which shows the order of processing of the DFSORT control statements and options:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA30/FIGSTMTSEQ?SHELF=&DT=20080528171007&CASE=&ScrollTOP=FIGSTMTSEQ#FIGSTMTSEQ

If you explain more clearly exactly what you're trying to do, I can show you how to do it. Showing examples of your input records and expected output records for the three files would help.
Back to top
View user's profile Send private message
Arunav

New User


Joined: 08 Jan 2009
Posts: 3
Location: India

PostPosted: Fri Jan 09, 2009 12:37 am
Reply with quote

Thanks Frank!

Since I need the same i/p file to be sorted in two different ways, I guess going for two different steps is my only option.

Actually I initially had two separate steps but since my input file has got huge data, it was throwing up performance issues. That's why I wanted to work around it using an existing sort step which has the same file as input.

Anyway I'll get back in case I have any further queries. Thank you!!
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: Fri Jan 09, 2009 12:42 am
Reply with quote

You actually need two passes, not two steps. You can use ICETOOL to do it in one step, but it will still require two passes over the input file.
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts C++ problems Java & MQSeries 3
No new posts Use input file with OMIT rcd keys? DFSORT/ICETOOL 15
Search our Forums:

Back to Top