Page 1 of 1

Selecting One Field from Block of dataset..

PostPosted: Sat Jun 27, 2009 4:57 pm
by gokulNmf
Hi all,
I am having 5 DS (DATA SET) of diffrent lrecl, but i want the first 10 charecter from all the DS, so i used the below code
to to get those 10 chars into the "PGM25.DS ENDDS.OUTPUT" .
but i am getting MAXCC 16 :( and checking in the SYSOUT :shock: the reason stated was
"INVALID DATA SET ATTRIBUTES: SORTIN LRECL - REASON CODE IS 05"
I couldnt make out the problem..
what is wrong in this code :? :x and how to solve it :?: :idea:

//SORT09   EXEC PGM=SORT
//SORTIN   DD  DSN=PGM125.END100.OUTPUT,
//             DISP=SHR
//         DD  DSN=PGM125.END103.OUTPUT,
//             DISP=SHR
//         DD  DSN=PGM125.VEND106.OUTPUT,
//             DISP=SHR
//         DD  DSN=PGM125.END107.OUTPUT,
//             DISP=SHR
//         DD  DSN=PGM125.END114.OUTPUT,
//             DISP=SHR
//SORTOUT  DD  DSN=PGM125.ENDDS.OUTPUT,
//             DISP=(NEW,CATLG,DELETE),
//             SPACE=(CYL,(2,2),RLSE),
//             DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//SYSIN    DD   *
  SORT FIELDS=(1,10,CH,A)
  INREC FIELDS =(1,10)
  SUM FIELDS=NONE
/*
//SYSOUT   DD  SYSOUT=*
//*


Thnaks in Advance.

Re: Selecting One Field from Block of dataset..

PostPosted: Sat Jun 27, 2009 5:58 pm
by gokulNmf
the lrel of
END100 is 09, END103 IS150, END106 IS 132, END107 IS 156 AND END114 IS 146

Re: Selecting One Field from Block of dataset..

PostPosted: Sat Jun 27, 2009 5:59 pm
by gokulNmf
gokulNmf wrote:the lrel of
END100 is 10, END103 IS150, END106 IS 132, END107 IS 156 AND END114 IS 146

Re: Selecting One Field from Block of dataset..

PostPosted: Sat Jun 27, 2009 11:05 pm
by dick scherrer
Hello,

"INVALID DATA SET ATTRIBUTES: SORTIN LRECL - REASON CODE IS 05"
I couldnt make out the problem..
The lrecl is the problem. . .

You should not concatenate fixed length records of different lengths. . .

You also want to bookmark (or download) this link to the Table of Contents in JCL Reference manual:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/CONTENTS?
And this:
http://publibz.boulder.ibm.com/cgi-bin/ ... 0/12.1.6.1?

Re: Selecting One Field from Block of dataset..

PostPosted: Sat Jun 27, 2009 11:12 pm
by Frank Yaeger
You can't use concatenated FB data sets with different LRECLs. You can use a DFSORT/ICETOOL job like the following instead. Since you had LRECL=80 for the output file, I assumed you wanted to pad the output records with blanks to 80 bytes.

//SORT09   EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1   DD  DSN=PGM125.END100.OUTPUT,
//          DISP=SHR
//IN2   DD  DSN=PGM125.END103.OUTPUT,
//          DISP=SHR
//IN3   DD  DSN=PGM125.VEND106.OUTPUT,
//          DISP=SHR
//IN4   DD  DSN=PGM125.END107.OUTPUT,
//          DISP=SHR
//IN5   DD  DSN=PGM125.END114.OUTPUT,
//          DISP=SHR
//T1   DD   DSN=&&T1,DISP=(MOD,PASS),
//          SPACE=(CYL,(2,2),RLSE),UNIT=SYSDA
//OUT   DD  DSN=PGM125.ENDDS.OUTPUT,
//          DISP=(NEW,CATLG,DELETE),
//          SPACE=(CYL,(2,2),RLSE),UNIT=SYSDA
//TOOLIN DD   *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN3) TO(T1) USING(CTL1)
COPY FROM(IN4) TO(T1) USING(CTL1)
COPY FROM(IN5) TO(T1) USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC FIELDS=(1,10)
/*
//CTL2CNTL DD *
  SORT FIELDS=(1,10,CH,A)
  SUM FIELDS=NONE
  OUTREC OVERLAY=(80:X)
/*

Re: Selecting One Field from Block of dataset..

PostPosted: Sun Jun 28, 2009 11:52 am
by gokulNmf
Thanks Dick and Frank, i was not aware :oops: that the DS with different length must'nt be concatenated :) ...