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

CAN OUTREC be specific to One OUTFIL in SYNCSORT ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sameer

New User


Joined: 10 Mar 2005
Posts: 41
Location: United States Of America

PostPosted: Wed Dec 21, 2011 6:22 pm
Reply with quote

Hi All,

When I tried to give OUTREC against two differrent OUTFIL FILES i am getting following error.

Can anyone know how to fix it ?
SYSIN :
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(111,2,CH,EQ,C'01')
OUTFIL FILES=02,INCLUDE=(111,2,CH,EQ,C'02')
OUTFIL FILES=03,INCLUDE=(111,2,CH,EQ,C'03')
OUTFIL FILES=04,INCLUDE=(111,2,CH,EQ,C'04')
OUTFIL FILES=05,INCLUDE=(111,2,CH,EQ,C'05')
OUTFIL FILES=06,INCLUDE=(111,2,CH,EQ,C'06')
OUTFIL FILES=SR,INCLUDE=(111,2,CH,EQ,C'50')
OUTFIL FILES=ER,INCLUDE=(111,2,CH,EQ,C'99')
OUTREC FIELDS=(1:14,70)
OUTFIL FILES=MS,INCLUDE=(6,2,CH,EQ,C'11',OR,6,2,CH,EQ,C'21')
OUTREC FIELDS=(1:03,42)
*
WER269A OUTREC 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
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 21, 2011 6:25 pm
Reply with quote

the WER prefix indicates that You are using SYNCSORT,
topic moved to the proper forum section
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 21, 2011 6:31 pm
Reply with quote

follow on,
the OUTREC statement as written is GLOBAL for the whole <sort>
to generate different layouts You must use the IFTHEN/BUILD construct
quite a few samples around
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Dec 21, 2011 6:37 pm
Reply with quote

Use the Build construct:

OUTFIL FILES=01,INCLUDE=(111,2,CH,EQ,C'01'),BUILD=(1:14,70)
repeat that for each line...
OUTFIL FILES=MS,INCLUDE=(6,2,CH,EQ,C'11',OR,6,2,CH,EQ,C'21'),
BUILD=(1:03,42)
Back to top
View user's profile Send private message
sameer

New User


Joined: 10 Mar 2005
Posts: 41
Location: United States Of America

PostPosted: Wed Dec 21, 2011 8:05 pm
Reply with quote

I tried with BUILD but its not working out..

SYSIN :
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(111,2,CH,EQ,C'01')
OUTFIL FILES=02,INCLUDE=(111,2,CH,EQ,C'02')
OUTFIL FILES=03,INCLUDE=(111,2,CH,EQ,C'03')
OUTFIL FILES=04,INCLUDE=(111,2,CH,EQ,C'04')
OUTFIL FILES=05,INCLUDE=(111,2,CH,EQ,C'05')
OUTFIL FILES=06,INCLUDE=(111,2,CH,EQ,C'06')
OUTFIL FILES=SR,INCLUDE=(111,2,CH,EQ,C'50')
OUTFIL FILES=ER,INCLUDE=(111,2,CH,EQ,C'99')
OUTREC BUILD=(1:14,42)
OUTFIL FILES=MS,INCLUDE=(6,2,CH,EQ,C'11',OR,6,2,CH,EQ,C'21')
OUTREC BUILD=(1:14,42)
*
WER269A OUTREC 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
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Dec 21, 2011 8:08 pm
Reply with quote

Did you even look at my example?

You need a BUILD for each OUTFIL.

Many of your BUILD statements will be the same.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 21, 2011 11:08 pm
Reply with quote

Hello,

Quote:
I tried with BUILD but its not working out..
Why did you not use the example provided?
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Thu Dec 22, 2011 1:29 am
Reply with quote

daveporcelan wrote:
Did you even look at my example?


That just made my day! You give the guy the EXACT syntax to use, he reads maybe 5% of what you posted, then comes back with "it doesn't work."

Gotta love it.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Dec 22, 2011 4:57 am
Reply with quote

To take Dave's example, and add SYMNAMES

Code:

//SYMNAMES DD *               
MAIN-FILE-INDICATOR,111,002,CH
MS-FILE-INDICATOR,006,002,CH 
TO-FILE01,C'01'               
TO-FILE02,C'02'               
TO-FILE03,C'03'               
TO-FILE04,C'04'               
TO-FILE05,C'05'               
TO-FILE06,C'06'               
TO-FILESR,C'50'               
TO-FILEER,C'99'               
TO-FILEMS-1,C'11'             
TO-FILEMS-2,C'21'             
OUTREC-FOR-MAIN-FILES,014,070
OUTREC-FOR-MS-FILE,003,042   


As your actual lengths for your output are unclear, I have left them as the original, but you can easily change them.

Code:

//SYSIN DD *
  SORT FIELDS=COPY                                           
                                                             
  OUTFIL FILES=01,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE01),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=02,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE02),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=03,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE03),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=04,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE04),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=05,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE05),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=06,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILE06),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=SR,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILESR),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=ER,INCLUDE=(MAIN-FILE-INDICATOR,EQ,TO-FILEER),
         BUILD=(1:OUTREC-FOR-MAIN-FILES)                     
                                                             
  OUTFIL FILES=MS,INCLUDE=(MS-FILE-INDICATOR,EQ,TO-FILEMS-1, 
                         OR,MS-FILE-INDICATOR,EQ,TO-FILEMS-2),
         BUILD=(1:OUTREC-FOR-MS-FILE)                         


Do you need the SORTOUT dataset as well as the above? If not, why not "TOOL" it?
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Thu Dec 22, 2011 12:46 pm
Reply with quote

Sameer,

See the code posted by " daveporcelan" and Try to identify what you have missed. There is a missing "Comma" in your code after the Include statement. And also instead of OUTREC BUILD/ OUTREC FIELDS give BUILD/FILEDS for OUTFIL FILES=ER and OUTFIL FILES=MS.

Thanks
-3nadh
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 Compare only first records of the fil... SYNCSORT 7
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
This topic is locked: you cannot edit posts or make replies. Construct new record using specific f... DFSORT/ICETOOL 6
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top