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

Using OUTREC/OUTFIL Together


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Jun 29, 2007 12:39 pm
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
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
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
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
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:26 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:36 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 2:52 pm
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
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
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: 1436
Location: Bangalore,India

PostPosted: Fri Jun 29, 2007 3:25 pm
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
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
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

Superior Member


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

PostPosted: Tue Jul 03, 2007 7:54 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts Sort w/OUTREC Question DFSORT/ICETOOL 2
No new posts Getting OUTREC - SHORT REC error for ... DFSORT/ICETOOL 12
Search our Forums:

Back to Top