Page 1 of 1

control card exceeding the length 72

PostPosted: Wed Aug 26, 2009 7:11 pm
by Mahalakshmi R
Hi All,

The following is the code which i wanted to code at SYSIN in SORT step.
  SORT FIELDS=COPY                                                   
  OUTREC FIELDS=(C'   OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')’,39X,
                 C’   OUTFIL FNAME=SORTOF04,INCLUDE= (24,8,CH,GT,C''',6,8,C''')',39X) 

As the following control statement exceeding its length 72 in JCL, I'm getting MaxComp as AB U0016.
  OUTREC FIELDS=(C'   OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')’,39X,


SYSOUT information:
[img]SYSIN :
SORT FIELDS=COPY
OUTREC FIELDS=
*
(C' OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')',39X,
*
C' OUTFIL FNAME=SORTOF04,INCLUDE= (24,8,CH,GT,C''',6,8,C''')',39X)
*
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT
WER275A NO KEYWORDS FOUND ON CONTROL STATEMENT [/img]

I also tried with the JCL continuation character '-' and did not get the results.

Can anyone suggest me to solve this issue.

Re: control card exceeding the length 72

PostPosted: Wed Aug 26, 2009 7:23 pm
by expat
I suggest that you take a little time and read the SYNCSORT manual for the correct syntax.

If you are trying to split a file by condition, then this may help with the correct synatx, although this is a DFSORT solution but the syntax is probably close enough.

//SORTIN   DD DSN=Input file 1,DISP=SHR         
//         DD DSN=Input file 2,DISP=SHR           
//SORTOF1  DD DSN=&&MCDSSORT,DISP=(,PASS,DELETE),   
//            SPACE=(CYL,(100,10),RLSE),             
//            RECFM=VB,LRECL=170                     
//SORTOF2  DD DSN=&&BCDSSORT,DISP=(,PASS,DELETE),   
//            SPACE=(CYL,(100,10),RLSE),             
//            RECFM=VB,LRECL=170                     
//SORTOF3  DD DSN=&&MGMTCLAS,DISP=(,PASS,DELETE),   
//            SPACE=(CYL,(10,10),RLSE)               
//SORTOF4  DD DSN=&&DASDSORT,DISP=(,PASS,DELETE),   
//            SPACE=(CYL,(170,10),RLSE),             
//            RECFM=VB,LRECL=170                     
//SORTOF5  DD DSN=&&VSAMSORT,DISP=(,PASS,DELETE),   
//            SPACE=(CYL,(170,10),RLSE),                 
//            RECFM=VB,LRECL=170                         
//SORTOF6  DD DSN=&&VSAMINDX,DISP=(,CATLG,DELETE),       
//            SPACE=(CYL,(170,10),RLSE),                 
//            RECFM=VB,LRECL=170                         
//SYSIN    DD *                                           
  OPTION  VLSHRT VLSCMP                                   
  SORT    FIELDS=(29,44,A),FORMAT=CH                     
  OUTFIL  FILES=1,INCLUDE=(9,2,CH,EQ,C'M ',AND,           
                189,1,BI,NONE,B'01000000',AND,           
                73,1,BI,ALL,B'10000000'),                 
          OUTREC=(1,4,29,44,1X,155,8,6X,C'M',1X,         
          205,4,1X,221,4,1X,193,4,1X,73,1),VLFILL=X'40'   
  OUTFIL  FILES=2,INCLUDE=(9,2,CH,EQ,C'B '),             
          OUTREC=(1,4,29,44,1X,155,8,6X,C'B'),VLFILL=X'40'
  OUTFIL  FILES=3,INCLUDE=(9,2,CH,EQ,C'MC')               

Re: control card exceeding the length 72

PostPosted: Thu Aug 27, 2009 11:30 am
by Mahalakshmi R
Thanks expat,

I got what you have mentioned.
The syntax which i have mentioned cannot split the files and used to build the characters which specified in C' ' to a PS file.

My requirement is to build the following statements into a PS file which has the record length of 80.

OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')
OUTFIL FNAME=SORTOF04,INCLUDE= (24,8,CH,GT,C''',6,8,C''')

That is from the 3rd position i need the line OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')
and remaining positions should be blank (in 80 record length). similar way the second line. Finally i need two records in my output file. This file will be used in many sort steps.

I hope now the requirement is much clear.

If we give these records into a SORTIN card also we can get that into SORTOUT file using option COPY.

Is there anyway we can modify only the control card to get the results.

Re: control card exceeding the length 72

PostPosted: Thu Aug 27, 2009 12:03 pm
by Mahalakshmi R
One more thing i forgot to mention.

The SORTIN file wich i have will contain the date field from position 6 (8 char).

This date will be taken to build the SORTOUT record.

The solution i tried is follows for one record:
Input:
SORTIN file contains position 6:8 as '20090529' and has only one record.

Controld card info:
SORT FIELDS=COPY                                                 
OUTREC FIELDS=(1:C'  ',                                           
   3:C'OUTFIL FNAME=SORTOF03,INCLUDE=(24,8,CH,LE,C''',6,8,C''')',
   23X)                                                           


Output:
OUTFIL FNAME=SORTOF03,INCLUDE=(24,8,CH,LE,C'20090529')

Similar way i need for the next record too in the same step.

Re: control card exceeding the length 72

PostPosted: Thu Aug 27, 2009 7:23 pm
by arcvns
Mahalakshmi R,

Instead of generating sort control statements, why not try creating symbols for the date value and access it using SYMNAMES. Here's an untested example for the same.
//STEP1    EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD DSN= Input date-file                             
//SORTOUT  DD DSN=&&S1,DISP=(,PASS)         
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                             
  INREC BUILD=(C'DATE-X,''',6,8,C'''',80:X)
  SORT FIELDS=COPY                           
//STEP2    EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD DSN= Input file                             
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTOF03  DD DSN= Output file
//SYSIN    DD *                       
  SORT FIELDS=COPY
  OUTFIL FNAMES=SORTOF03,INCLUDE=(24,8,CH,LE,DATE-X)
  OUTFIL FNAMES=SORTOF04,INCLUDE=(24,8,CH,GT,DATE-X)

Re: control card exceeding the length 72

PostPosted: Thu Aug 27, 2009 8:03 pm
by Mahalakshmi R
Thanks a lot Arun.

I have modified the code as you have mentioned.
This working perfectly.

Re: control card exceeding the length 72

PostPosted: Thu Aug 27, 2009 9:23 pm
by arcvns
Mahalakshmi R

You're welcome. Good to hear it's working :)

Can you post here your final control cards?

Re: control card exceeding the length 72

PostPosted: Fri Aug 28, 2009 10:48 am
by Mahalakshmi R
As my priority was to get the date and generate the control cards at the first step, i did not change the sytax in the statements
OUTFIL FNAME=SORTOF03,INCLUDE= (24,8,CH,LE,C''',6,8,C''')
OUTFIL FNAME=SORTOF04,INCLUDE= (24,8,CH,GT,C''',6,8,C''')

The modified and final code is follows:
first step:
INREC BUILD=(C'DATE-X,''',6,8,C'''',80:X)
SORT FIELDS=COPY                         


second step:
SORT FIELDS=COPY                             
  OUTFIL FILES=03,INCLUDE=(24,8,CH,LE,DATE-X)
  OUTFIL FILES=04,INCLUDE=(24,8,CH,GT,DATE-X)


Once again thanks Arun.

Re: control card exceeding the length 72

PostPosted: Mon Aug 31, 2009 9:53 pm
by arcvns
Mahalakshmi Rajendran,

If you have only 2 conditions as shown above, you can further simplify it using the SAVE parameter which captures all the records which got skipped in the first INCLUDE.
  SORT FIELDS=COPY                             
  OUTFIL FILES=03,INCLUDE=(24,8,CH,LE,DATE-X)
  OUTFIL FILES=04,SAVE