Page 1 of 2

SORT FIELDS=(1,32,CH,A)

PostPosted: Tue Feb 28, 2012 10:51 pm
by dn2012
Hello,

I have following step in my current JCL for sort.

//SORT    EXEC PGM=SORT,COND=(0,NE,LISTCAT)                           
//SORTIN   DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(DEFAULT)       
//         DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(CWS)           
//         DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(TCIS0228)       
//         DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(PDB) ## 10/28/11
//         DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(ETRS1211)       
//SORTOUT  DD DISP=(NEW,CATLG,DELETE),                               
//            DSN=IMSTESTA.IMF310.ITD.SOURCE.DATA.GDG(+1),           
//            SPACE=(CYL,(10,10)),UNIT=SYSDA,                         
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=32000)                   
//SYSOUT   DD SYSOUT=*                                               
//SYSPRINT DD SYSOUT=*                                               
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                         
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                         
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                         
//SORTWK04 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                         
//SORTWK05 DD UNIT=SYSDA,SPACE=(CYL,(10,10))                         
//SORTWK06 DD UNIT=SYSDA,SPACE=(CYL,(10,10))
//*    SORT FIELDS=(1,32,CH,A)             
//SYSIN    DD *                             
  SORT FIELDS=(1,32,CH,A)                   
  SUM FIELDS=NONE                           
/*                                         


Now I want this will be process the records under group MCIPROB from the IMSTESTA.IMF310.ITD.SOURCE(TCIS0228).
IS it ok to use as SORT FIELDS=(1,32,CH,A,MCIPROB)

I appreciate your help.

Thank You

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Tue Feb 28, 2012 11:00 pm
by dn2012
I did put SORT FIELDS=(1,32,CH,A,MCIPROB) but getting error as

ICE007A P SYNTAX ERROR
SUM FIELDS=NONE
ICE052I J END OF DFSORT

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Tue Feb 28, 2012 11:23 pm
by enrico-sorichetti
since the forum has the sections dedicated to the most common sort product SYNCSORT and DFSORT/ICETOOL
it is wiser to post in the proper sections

it just a waste of time to invent Your own control statements syntax
better spend time reading and meditating on the the manuals ...
DFSORT/ICETOOL Reference Material

and to search the forum for snippets and examples

also to get good help it is necessary to describe in a proper way the requirement and the environment

DCBs of input and output files
the process to be done
significant excerpts of the input file records
and the output expected based on the above
naturally when showing the input and output records helps to describe the requirement

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 12:49 am
by Frank Yaeger
Now I want this will be process the records under group MCIPROB from the IMSTESTA.IMF310.ITD.SOURCE(TCIS0228).
IS it ok to use as SORT FIELDS=(1,32,CH,A,MCIPROB)


Your description of what you want to do is not at all clear so nobody can help you.

What do you mean by the "group MCIPROB"? Do you mean records that have "MCIPROB" in some specific positions, or anywhere in the record, or something entirely different. SORT FIELDS=(1,32,CH,A) sorts ascending on positions 1-32. What does that have to do with MCIPROB? Are you looking to INCLUDE records that have MCIPROB? You have to explain clearly what you want to do before anyone can help you.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 12:55 am
by dn2012
we have data in 'IMSTESTA.IMF310.ITD.SOURCE(TCIS0228)" as

MCTPCLDRC000300         MCIJSD  ..........
MCTPMNAMC000300         MCIJSD  ..........
MCTPMCASC000300         MCIJSD  ..........
MCTPMCA1C000300         MCIJSD  ..........
MCTPCLDRC000493         MCIPROB ..........
MCTPMNAMC000493         MCIPROB ..........
MCTPMCASC000493         MCIPROB ..........
MCTPMCA1C000493         MCIPROB ..........
MCTPCLDRC000526         MCIPROB ..........
MCTPMNAMC000526         MCIPROB ..........
MCTPMCASC000526         MCIPROB ..........

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 1:28 am
by Frank Yaeger
You can use a DFSORT job like the following to "process" the records with MCIPROB from 'IMSTESTA.IMF310.ITD.SOURCE(TCIS0228)" in the same way you are processing the records from multiple data sets:

//S1   EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DISP=OLD,DSN=IMSTESTA.IMF310.ITD.SOURCE(TCIS0228)
//SORTOUT  DD DSN=...  output file
//SYSIN    DD *
   INCLUDE COND=(p,7,CH,EQ,C'MCIPROB')
   SORT FIELDS=(1,32,CH,A)
   SUM FIELDS=NONE
/*


Change p to the starting position of MCIPROB in your records (e.g. 33? 34?)

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 1:50 am
by dn2012
Thanks

But I am getting SDSF output as

ICE000I J - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 12:19 ON TUE FE
INCLUDE COND=(P,7,CH,EQ,C'MCIPROB')
$
ICE007A 1 SYNTAX ERROR
SORT FIELDS=(1,32,CH,A)
SUM FIELDS=NONE
ICE052I J END OF DFSORT

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 1:58 am
by Akatsukami
dn2012 wrote:Thanks

But I am getting SDSF output as

ICE000I J - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 12:19 ON TUE FE
INCLUDE COND=(P,7,CH,EQ,C'MCIPROB')
$
ICE007A 1 SYNTAX ERROR
SORT FIELDS=(1,32,CH,A)
SUM FIELDS=NONE
ICE052I J END OF DFSORT

What part of
Frank Yaeger wrote:Change p to the starting position of MCIPROB in your records (e.g. 33? 34?)

didn't you understand?

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 2:02 am
by dn2012
thanks

INCLUDE COND=(26,7,CH,EQ,C'MCIPROB')

Out from SDSF:

ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 206261
ICE054I 0 RECORDS - IN: 206261, OUT: 0
ICE173I 0 NO RECORDS FOR THE SORTOUT DATA SET - RC=0
ICE134I 0 NUMBER OF BYTES SORTED: 0
ICE253I 0 RECORDS SORTED - PROCESSED: 0, EXPECTED: 3704000
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 900 , TRACKS USED: 0
ICE199I 0 MEMORY OBJECT USED AS MAIN STORAGE = 0M BYTES
ICE299I 0 MEMORY OBJECT USED AS WORK STORAGE = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT

Re: SORT FIELDS=(1,32,CH,A)

PostPosted: Wed Feb 29, 2012 2:14 am
by enrico-sorichetti
from the data You posted the MCI... stuff starts at 25,
but if the record format is variable You should add 4 to the position You see when browsing the data under ISPF