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

Need clarification on OUTFIL and OUTREC in SYNCSORT


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

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Fri Nov 23, 2007 12:21 pm
Reply with quote

Hi I have a small query. Take the jcl below:

Code:
//STEP1 EXEC PGM=SYNCTOOL                                 
//DFSMSG DD SYSOUT=*                                     
//TOOLMSG DD SYSOUT=*                                     
//INDD DD *                                               
AAAAAAAAAAAAAAAA                                         
BBBBBBBBBBBBBBBB                                         
CCCCCCCCCCCCCCCC                                         
DDDDDDDDDDDDDDDD                                         
/*                                                       
//TEMP1 DD DSN=&&TEMP1,DISP=(NEW,PASS),SPACE=(CYL,(1,1)),
//         UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)             
//TEMP2 DD DSN=&&TEMP2,DISP=(NEW,PASS),SPACE=(CYL,(1,1)),
//         UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)             
//DCNFL  DD DSN=&&DCNFL,DISP=(MOD,PASS),SPACE=(CYL,(1,1)),
//       UNIT=SYSDA,DCB=(RECFM=FB,LRECL=80)               
//OUTDD DD SYSOUT=*                                       
//TOOLIN DD *                                             
  SORT FROM(INDD) USING(CT21)                             
  SORT FROM(TEMP2) TO(DCNFL) USING(CT22)                 
  SORT FROM(TEMP1) TO(DCNFL) USING(CT23)
  COPY FROM(DCNFL) TO(OUTDD)           
/*                                     
//CT21CNTL DD *                         
  INREC OVERLAY(81:SEQNUM,5,PD)         
  SORT FIELDS=(81,5,PD,D)               
  OUTFIL FNAMES=TEMP1,ENDREC=1,         
  OUTREC=(1,80)                         
  OUTFIL FNAMES=TEMP2,SAVE,             
  OUTREC=(1,80)                         
/*                                     
//CT22CNTL DD *                         
  OPTION COPY                           
  OUTFIL BUILD=(C' ''',1,16,C''',')     
/*                                     
//CT23CNTL DD *                         
  OPTION COPY                           
  OUTFIL BUILD=(C' ''',1,16,C'''')     
/*                                     


The above JCL gives error as :

Code:
CT22CNTL :                                                                     
  OPTION COPY                                                           0035000
  OUTFIL BUILD=(C' ''',1,16,C''',')                                     0036000
PARMLIST :                                                                     
OPTION RESINV=0,ARESINV=0,MSGDDN=DFSMSG,SORTIN=TEMP2,SORTOUT=DCNFL,SORTDD=CT22,
YNALLOC                                                                       
WER428I  CALLER-PROVIDED IDENTIFIER IS "0002"                                 
WER276B  SYSDIAG= 234923, 771498, 771498, 1039071                             
WER164B  5,000K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,             
WER164B     0 BYTES RESERVE REQUESTED, 500K BYTES USED                         
WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                               
WER108I  TEMP2    : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER110I  DCNFL    : RECFM=FB   ; LRECL=    80; BLKSIZE=    80                 
WER247A  DCNFL    HAS INCOMPATIBLE LRECL                                       
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                                 


Whereas if we use the CT22 & CT23 card as

Code:
OUTREC BUILD=(C' ''',1,16,C''',') 

&
Code:
OUTREC BUILD=(C' ''',1,16,C'''')


Then I get the desired o/p as:

Code:
'CCCCCCCCCCCCCCCC',
'BBBBBBBBBBBBBBBB',
'AAAAAAAAAAAAAAAA',
'DDDDDDDDDDDDDDDD'

Why so?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 23, 2007 12:32 pm
Reply with quote

Learncoholic,

Could you please post the desired output?
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Fri Nov 23, 2007 12:34 pm
Reply with quote

Aaru,

Quote:
Could you please post the desired output?

TS had already did that.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 23, 2007 2:11 pm
Reply with quote

Learncoholic,

Try this sort card

Code:
//CT22CNTL DD *                                             
  OPTION COPY                                               
  OUTFIL BUILD=(C' ''',1,16,C''',',80:X)                     
/*                                                           
//CT23CNTL DD *                                             
  OPTION COPY                                               
  OUTFIL BUILD=(C' ''',1,16,C'''',80:X)                     
/*                                                           
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Mon Nov 26, 2007 11:34 am
Reply with quote

Hi Aaru,

The sort card you have provided is absolutely fine. Thanks for that. I also want to know as to why we have to give 80:X in the sort card with outfil? Is it mandatory? Moreover in the error report(that I posted along with my previous query) it is showing to have both the LRECL as the same yet the error is:
Code:
WER247A  DCNFL    HAS INCOMPATIBLE LRECL                                       

Why does this happen?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Nov 26, 2007 11:45 am
Reply with quote

Learncoholic,

Quote:
also want to know as to why we have to give 80:X in the sort card with outfil?


The record length is specified as 80 across the DD DCNFL. Hence you should BUILD in such a way that the record is with data in these 80 bytes. Hence it is good to pad the remaining with spaces. 80:X will update the record with spaces from the current position to the column specified (80)

Quote:
WER247A DCNFL HAS INCOMPATIBLE LRECL


This might be also because of the same reason.

Quote:
The sort card you have provided is absolutely fine. Thanks for that.


Good that it woked.
Back to top
View user's profile Send private message
Learncoholic

New User


Joined: 20 Sep 2007
Posts: 97
Location: India

PostPosted: Mon Nov 26, 2007 11:49 am
Reply with quote

Thanks Aaru for the clarifications.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Mon Nov 26, 2007 2:38 pm
Reply with quote

You are Welcome icon_biggrin.gif
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
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
Search our Forums:

Back to Top