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
 

 

Using OUTREC/OUTFIL Together

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

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 12:35 pm    Post subject: Using OUTREC/OUTFIL Together
Reply with quote

I have a file with 30 bytes with 3 fields of 10 bytes each.
I need to split this files into different files depending on the continents which is present in bytes 11 to 20.
and if the continent is Europe or N America i want the third field to be written to file other wise i want the first filed to written to file

Code:

  OUTFIL FILES=1,OUTREC=(1:10,10),         
    INCLUDE=(11,10,CH,EQ,C'ASIA      ')       
  OUTFIL FILES=2,OUTREC=(1:10,10),         
    INCLUDE=(11,10,CH,EQ,C'AFRICA    ')       
  OUTFIL FILES=3,OUTREC=(1:21,10),         
    INCLUDE=(11,10,CH,EQ,C'EUROPE    ')       
  OUTFIL FILES=4,OUTREC=(1:21,10),         
    INCLUDE=(11,10,CH,EQ,C'N AMERICA ')                   
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jun 29, 2007 12:39 pm    Post subject:
Reply with quote

It looks like it should work, are you having a problem with it?
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 1:02 pm    Post subject: SYNTAX ERROR
Reply with quote

No, It is not working
it gives a clean scan but when i run the job it abends with U016

Code:

  SORT FIELDS=COPY                           
  OUTFIL FILES=01,OUTREC=(1:10,10),         
    INCLUDE COND=(11,10,CH,EQ,C'ASIA      ')   
  OUTFIL FILES=02,OUTREC=(1:10,10),         
    INCLUDE COND=(11,10,CH,EQ,C'AFRICA    ')   
  OUTFIL FILES=03,OUTREC=(1:21,10),         
    INCLUDE COND=(11,10,CH,EQ,C'EUROPE    ')   
  OUTFIL FILES=04,OUTREC=(1:21,10),         
    INCLUDE COND=(11,10,CH,EQ,C'N AMERICA ')   



This is the sort card i gave and these are the messages
Code:

WER268A  OUTFIL STATEMENT  : SYNTAX ERROR               
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR               
WER269A  INCLUDE STATEMENT : DUPLICATE STATEMENT FOUND 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR               
WER269A  INCLUDE STATEMENT : DUPLICATE STATEMENT FOUND 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR               
WER269A  INCLUDE STATEMENT : DUPLICATE STATEMENT FOUND 
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE           
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jun 29, 2007 1:19 pm    Post subject:
Reply with quote

antonyjoseph
If you are getting this message WER268A, then it is a syntax error, ant it would point in the next line to the error location using *.

Try to check with that error.
Or post the SYSOUT part of it where it is pointing with *, in the successive line!
Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Fri Jun 29, 2007 1:30 pm    Post subject:
Reply with quote

Hi You can try this


DD01 DD DSN === first dataset of LREC 10
...
DD04 dd dsn====last datset

Code:

//SYSIN DD *
  SORT FIELDS=COPY                           
  OUTFIL FNAMES=DD01,OUTREC=(1:10,10),         
    INCLUDE COND=(11,10,CH,EQ,C'ASIA      ')   
  OUTFIL FNAMES=DD02,OUTREC=(1:10,10),         
    INCLUDE COND=(11,10,CH,EQ,C'AFRICA    ')   
  OUTFIL FNAMES=DD03,OUTREC=(1:21,10),         
    INCLUDE COND=(11,10,CH,EQ,C'EUROPE    ')   
  OUTFIL FNAMES=DD04,OUTREC=(1:21,10),         
    INCLUDE COND=(11,10,CH,EQ,C'N AMERICA ')   
/*


Thanks sandeep
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jun 29, 2007 1:31 pm    Post subject:
Reply with quote

antonyjoseph
Check whether you have a Blank here, That is between OUTREC and =
Code:
OUTFIL FILES=1,OUTREC =(1:10,10),         
                                             

If so, correct it.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 2:21 pm    Post subject:
Reply with quote

The blanks was one of the issue but got that sorted out but still hitting syntax errors

Code:


SYSIN :                                   
  SORT FIELDS=COPY                         
  OUTFIL FILES=01,OUTREC=(1:10,10),       
  INCLUDE COND=(11,10,CH,EQ,C'ASIA      ')
         *                                 
  OUTFIL FILES=02,OUTREC=(1:10,10),       
  INCLUDE COND=(11,10,CH,EQ,C'AFRICA    ')
         *                                 
  OUTFIL FILES=03,OUTREC=(1:21,10),       
  INCLUDE COND=(11,10,CH,EQ,C'EUROPE    ')
         *                                 
  OUTFIL FILES=04,OUTREC=(1:21,10),       
  INCLUDE COND=(11,10,CH,EQ,C'N AMERICA ')
         *                                 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR 
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR   
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR   
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:26 pm    Post subject:
Reply with quote

Quote:
OUTFIL FILES=02,OUTREC=(1:10,10),
INCLUDE COND=(11,10,CH,EQ,C'AFRICA


OUTFIL FILES should be OUTFIL FNAMES.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 2:32 pm    Post subject:
Reply with quote

FNAMES are used when you are not using SORTOF right
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:36 pm    Post subject:
Reply with quote

Quote:
FNAMES are used when you are not using SORTOF right

Refer the manual for OUTFIL syntax and let us know what you had found.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 2:48 pm    Post subject:
Reply with quote

I tried with FNAMES.... same result
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:52 pm    Post subject:
Reply with quote

Joseph,

Remeber to copy the spool messages always as it helps us in solving the error.
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Jun 29, 2007 3:05 pm    Post subject:
Reply with quote

Code:


SYSIN :                                       
  SORT FIELDS=COPY                           
  OUTFIL FNAMES=01,OUTREC=(1:10,10),         
         *                                   
  INCLUDE COND=(11,10,CH,EQ,C'ASIA      ')   
  OUTFIL FNAMES=02,OUTREC=(1:10,10),         
         *                                   
  INCLUDE COND=(11,10,CH,EQ,C'AFRICA    ')   
  OUTFIL FNAMES=03,OUTREC=(1:21,10),         
         *                                   
  INCLUDE COND=(11,10,CH,EQ,C'EUROPE    ')   
  OUTFIL FNAMES=04,OUTREC=(1:21,10),         
         *                                   
  INCLUDE COND=(11,10,CH,EQ,C'N AMERICA ')   
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR     
WER268A  OUTFIL STATEMENT  : SYNTAX ERROR     
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

Back to top
View user's profile Send private message
sandeep1dimri

New User


Joined: 30 Oct 2006
Posts: 76

PostPosted: Fri Jun 29, 2007 3:14 pm    Post subject:
Reply with quote

Hi joseph,

hve u tried the code that i provided earlier if yes and ur still getting error pls provide the full code for the SYNCSORT(including DD statments)

Thanks
sandeep
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 3:25 pm    Post subject:
Reply with quote

joseph,

I have not worked with syncsort extensively. In DFSORT your requirment looks like -

Code:

   OUTFIL FNAMES=XYZ,
      OUTREC=(......),
      INCLUDE=(.....)


Test the above code.
Back to top
View user's profile Send private message
wicked1925

New User


Joined: 12 Mar 2007
Posts: 15
Location: Philippines

PostPosted: Tue Jul 03, 2007 3:00 pm    Post subject:
Reply with quote

I think you should use OUTFIL FNAMES=DD01 where DD01 is your DD statement name, it should not be OUTFIL FNAMES=01.
Back to top
View user's profile Send private message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Tue Jul 03, 2007 6:11 pm    Post subject: Re: Using OUTREC/OUTFIL Together
Reply with quote

Try using the below control statements and rerun.... The SORTOF01 has to be of LRECL 10 or else u have to pad the 70 spaces as below to get the results.

Code:
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(11,10,CH,EQ,C'ASIA      '),
OUTREC=(1:10,10,70X)


Regards,
Syam
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Jul 03, 2007 7:54 pm    Post subject:
Reply with quote

Hi,

Please provide some sample data of input & the desired output, we can suggest some better solution. By the time, try the below code:
Code:
SORT FIELDS=COPY                       
OUTFIL FILES=1, INCLUDE=(11,10,CH,EQ,C'ASIA      ')       
OUTFIL FILES=2,INCLUDE=(11,10,CH,EQ,C'AFRICA    ')
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 05, 2007 12:09 pm    Post subject:
Reply with quote

antonyjoseph
use this syntax, this should work with SYNCSORT
Code:
OUTFIL FILES=1,
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 05, 2007 12:23 pm    Post subject:
Reply with quote

antonyjoseph
Considering your statements,
Code:
SYSIN :                                   
  SORT FIELDS=COPY                         
  OUTFIL FILES=01,OUTREC=(1:10,10),       
  INCLUDE COND=(11,10,CH,EQ,C'ASIA      ')
         *                                 
  OUTFIL FILES=02,OUTREC=(1:10,10),       
  INCLUDE COND=(11,10,CH,EQ,C'AFRICA    ')
         *                                 
  OUTFIL FILES=03,OUTREC=(1:21,10),       
  INCLUDE COND=(11,10,CH,EQ,C'EUROPE    ')
         *                                 
  OUTFIL FILES=04,OUTREC=(1:21,10),       
  INCLUDE COND=(11,10,CH,EQ,C'N AMERICA ')
         *                                 


In OUTFIL statement you need not use "INCLUDE COND=",
Instead just use "INCLUDE="
Otherwise everything else looks fine.
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 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 OUTREC RDW NOT INCLUDED krsenthil85 SYNCSORT 10 Fri May 06, 2016 3:22 am
No new posts OUTREC on OUTFIL error rocky_balboa DFSORT/ICETOOL 4 Thu Aug 27, 2015 10:26 am
No new posts OUTREC with IFTHEN Query... mkk157 DFSORT/ICETOOL 1 Wed Aug 26, 2015 5:17 pm


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