Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

[Solved]Can we use INCLUDE & OUTREC together in OUTFIL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
suvarna

New User


Joined: 24 Aug 2005
Posts: 13

PostPosted: Fri Aug 26, 2005 10:42 am    Post subject: Can we use INCLUDE & OUTREC together in OUTFIL?
Reply with quote

Hi Guys,

Thanks to all of u for ur help.
I am solving that problem in a different way combining JCL & REXX.

I am facing a new problem now. I am trying to sort a file into four different output files using OUTFIL. But i dont want the entire record. So I used INCLUDE COND to achieve that. Again i want to truncate some parts from that record. For this when i use OUTREC the job is abending that the syntax is not correct.

When this syntax is used the output is
CTR301I MOB.#CO.R01.RT01.I402P01.INSURANC.G0021V00 +001 CB
in one line

//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')

But when i use the following syntax it is abending.
//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
OUTREC FIELDS=(1:14,42)

Can u help me to solve it ?
Back to top
View user's profile Send private message

radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Fri Aug 26, 2005 11:39 am    Post subject:
Reply with quote

Using ICETOOL,its working.

Code:
//CTL1CNTL     DD  * *** CONSTANT CONTROL CARDS *** 
  SORT FIELDS=(1,1,CH,A)                             
  OUTFIL FNAMES=OUT1,                               
  INCLUDE=(1,1,CH,EQ,C'2')                           
  OUTREC FIELDS=(1:1,6)                             
  OUTFIL FNAMES=OUT2,                               
  INCLUDE=(1,1,CH,EQ,C'1')                           
  OUTREC FIELDS=(2:1,6)                             


the output is as expected.
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 436
Location: chennai, India

PostPosted: Fri Aug 26, 2005 11:51 am    Post subject:
Reply with quote

suvarna,

try this

Code:
//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FNAMES=1,   replace FILES with FNAMES
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
OUTREC FIELDS=(1:14,42)
Back to top
View user's profile Send private message
suvarna

New User


Joined: 24 Aug 2005
Posts: 13

PostPosted: Fri Aug 26, 2005 2:29 pm    Post subject: Re: Can we use INCLUDE & OUTREC together in OUTFIL?
Reply with quote

Hi Guys

Thanks to u all for the help :-)
It is working now.
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: Fri Aug 26, 2005 8:56 pm    Post subject:
Reply with quote

The problem here is that you don't understand the "order" of processing of the control statements.

You used:

Code:

  SORT FIELDS=(14,42,CH,A)
  OUTFIL FILES=1,
     INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
  OUTREC FIELDS=(1:14,42)


Regardless of the order in which you code the statements, they are processed in the following order: SORT statement, OUTREC statement, OUTFIL statements. The OUTREC statement reformats the sorted records to 42 bytes. The OUTFIL INCLUDE operates against the reformatted record, but tries to access 39,8 which is beyond the end of the 42-byte reformatted record.

What you probably want is to use the OUTREC parameter of OUTFIL rather than the OUTREC statement, e.g.

Code:

  SORT FIELDS=(14,42,CH,A)
  OUTFIL FILES=1,
     INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC'),
     OUTREC=(1:14,42)


The order of processing in this case is: SORT statement, OUTFIL INCLUDE, OUTFIL OUTREC. So the OUTFIL INCLUDE operates against the sorted input records, and the OUTFIL OUTREC operates against the included records.

Quote:
Using ICETOOL,its working.

Code:
//CTL1CNTL DD * *** CONSTANT CONTROL CARDS ***
SORT FIELDS=(1,1,CH,A)
OUTFIL FNAMES=OUT1,
INCLUDE=(1,1,CH,EQ,C'2')
OUTREC FIELDS=(1:1,6)
OUTFIL FNAMES=OUT2,
INCLUDE=(1,1,CH,EQ,C'1')
OUTREC FIELDS=(2:1,6)


Well in this case the first OUTREC statement reformats the records to 6 bytes and the OUTFIL INCLUDEs operate against those 6 bytes. Since the INCLUDEs have 1,1, it doesn't matter if they operate against the input records or the reformatted records - position 1 has the same value eiter way. The second OUTREC statement is ignored as a duplicate.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us