|
View previous topic :: View next topic
|
| Author |
Message |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
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 |
|
 |
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
| It looks like it should work, are you having a problem with it? |
|
| Back to top |
|
 |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
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 |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
 |
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
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 |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
 |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
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 |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
| 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 |
|
 |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
| FNAMES are used when you are not using SORTOF right |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
| 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 |
|
 |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
| I tried with FNAMES.... same result |
|
| Back to top |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Joseph,
Remeber to copy the spool messages always as it helps us in solving the error. |
|
| Back to top |
|
 |
antonyjoseph
New User

Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
| 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 |
|
 |
sandeep1dimri
New User
Joined: 30 Oct 2006 Posts: 76
|
|
|
|
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 |
|
 |
murmohk1
Senior Member
.jpg)
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
 |
wicked1925
New User

Joined: 12 Mar 2007 Posts: 15 Location: Philippines
|
|
|
|
| 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 |
|
 |
skkp2006
New User

Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
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 |
|
 |
Anuj Dhawan
Superior Member

Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
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 |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
antonyjoseph
use this syntax, this should work with SYNCSORT
|
|
| Back to top |
|
 |
krisprems
Active Member

Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|