Page 1 of 1

JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 2:43 pm
by Sunitha.P
Hi...
I need a JCL which sorts data . I want the JCL to perform the SORT function using in-stream data. I dont want to use a COBOL prgm for this. Can anyone pls post a working-JCL to sort ...

Re: JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 3:38 pm
by jayind
I dont have Mainframe access at this moment and hence could not try... hope the following code helps you..

//STEP1   EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
data1vvvmmmmdddd
data2kkkkuuuuuubbb
data3iii4i444400kkki
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
* Sort descending on first 5 bytes of input stream,
   SORT FIELDS=(1,5,CH,D)
/*


let me know the result.

Re: JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 4:39 pm
by Sunitha.P
//UADT006C JOB NOTIFY=&SYSUID,REGION=0M           
//STEP1 EXEC PGM=IEFBR14                           
//SYSOUT DD SYSOUT=*                               
//SORTIN DD *                                     
DATA1VVVMMMMDDDD                                   
DATA2KKKKUUUUUUBBB                                 
DATA3III4I444400KKKI                               
/*                                                 
SYSIN DD*                                         
SORT FIELDS=(1,5,CH,D)                             
/*     


This is what i have written from ur code. Its not identifying the job at all.. Its not recognizing it as a JCL. Wen i try to submit it, It is asking me to Enter JobName Character(s)..Whats the fault with what i have written ?

Re: JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 5:17 pm
by jayind
Hello,

Few mistakes in your JCL..

Take the job card from an existing TEST JCLs in your system to avoid mistakes...

Please cross verify your JCL with the sample JCL step i have given and make sure there are no mistakes.. it will work..

Re: JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 5:39 pm
by Sunitha.P
jayind wrote:Hello,
Take the job card from an existing TEST JCLs in your system to avoid mistakes.....


I dint understand this statement... :?

Re: JCL to Sort using In-Stream Data

PostPosted: Thu Jun 05, 2008 6:15 pm
by dick scherrer
Hello Sunitha.P and welcome to the forums,

A major problem with your jcl is that you changed the exec to IEFBR14. I do not understand the change, but IEFBR14 will not sort data - it does not execute any processing code (it merely ends). You need to change so that your jcl uses your sort product.

If you do not know how sort is invoked on your system, ask one of your peers or the system support people. You should ask thos people for a "standard" job card (as was already mentioned).

Re: JCL to Sort using In-Stream Data

PostPosted: Sun Jun 29, 2008 10:08 pm
by Sarfraz S
Hello Sunitha,
You can also use EXEC PGM=SORT..... As for the "Enter jobnames" issue, it will be because the jcl was not prepared properly. You could have missed few steps.... And though this Enter jobnames comes up, jus type in something and enter, your job will be processed and you will get the required output, unless there is any abend or MAXCC > 4. If u dont want to see the Enter jobnames intimation, I suggest that you recheck you r job card and steplib.