Re: JCL Sort

2012-09-24 Thread Ron Thomas
Thanks a lot Kolusu.. you rock!

Thanks,
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL Sort

2012-09-21 Thread Ron Thomas
Thanks a bunch Kolusu.. , just want to check with you if i have a additional 
field to be checked say for e.g if the 25'th field is 01PS then how we can 
modify the same job?

Thanks,
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL Sort

2012-09-21 Thread Sri h Kolusu
Ron,

If the value 01PS exist on every record, then you can simply modify the 
INCLUDE cond on OUTFIL. Something like this 

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD * 
+1+2+3+4+5+6+ 
101   10001   T 01PS  ABC 
102   10001 01PS   PRS 
103   10001 01PS   XYE 
101   10002   T 02PS  ABC 
102   10002 02PS   PRS 
103   10002 02PS   XYE 
101   10003   A   ABC 
102   10003PRS 
103   10003XYE 
//SORTOUT  DD SYSOUT=* 
//SYSINDD * 
  OPTION COPY 
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(11,5),PUSH=(81:23,1)) 
  OUTFIL BUILD=(1,80), 
  INCLUDE=(81,1,CH,EQ,C'T',AND,25,4,CH,EQ,C'01PS') 
//* 

If that is not how your data looks like then you need to show me a sample 
of input  and I can show you a way to get the results.

Thanks,
Sri Hari Kolusu
DFSORT Development
IBM Corporation
Email: skol...@us.ibm.com
Phone: 408-463-2403 Tie Line 543-2403

IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu wrote on 
09/21/2012 07:58:03 AM:

 From: Ron Thomas ron5...@gmail.com
 To: IBM-MAIN@listserv.ua.edu, 
 Date: 09/21/2012 07:59 AM
 Subject: Re: JCL Sort
 Sent by: IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu
 
 Thanks a bunch Kolusu.. , just want to check with you if i have a 
 additional field to be checked say for e.g if the 25'th field is 
 01PS then how we can modify the same job?
 
 Thanks,
 Ron T
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
 

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: JCL Sort

2012-09-20 Thread Sri h Kolusu
Ron,

Assuming that the Emp-status field is on the first record for every 
Emp-no, the following DFSORT JCL will give you the desired results. I 
assumed that your LRECL=80 and RECFM=FB

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=* 
//SORTIN   DD * 
101   10001   T   ABC 
102   10001PRS 
103   10001XYE 
101   10002   T   ABC 
102   10002PRS 
103   10002XYE 
101   10003   A   ABC 
102   10003PRS 
103   10003XYE 
//SORTOUT  DD SYSOUT=* 
//SYSINDD * 
  OPTION COPY 
  INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(11,5),PUSH=(81:23,1)) 
  OUTFIL BUILD=(1,80),INCLUDE=(81,1,CH,EQ,C'T') 
//* 

The output from this job is 

101   10001   T   ABC 
102   10001PRS 
103   10001XYE 
101   10002   T   ABC 
102   10002PRS 
103   10002XYE 


Thanks,
Sri Hari Kolusu
DFSORT Development
IBM Corporation
Email: skol...@us.ibm.com
Phone: 408-463-2403 Tie Line 543-2403

IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu wrote on 
09/20/2012 10:54:53 AM:

 From: Ron Thomas ron5...@gmail.com
 To: IBM-MAIN@listserv.ua.edu, 
 Date: 09/20/2012 10:55 AM
 Subject: JCL Sort
 Sent by: IBM Mainframe Discussion List IBM-MAIN@listserv.ua.edu
 
 Hello Listeners,
 
 I have a input sequential file as below
 
 segno   empnoempstatus  restofdetails
 101   10001   T   ABC
 102   10001PRS
 103   10001XYE
 101   10002   T   ABC
 102   10002PRS
 103   10002XYE
 101   10003   A   ABC
 102   10003PRS
 103   10003XYE
 
 
 Here in the above file i need to pull all of the records having 
 empstatus = 'T' using a sort
 The issue is if the empstatus is T' i need to pull the related of 
 the empno to the outfile also
 
 sample o/p is below
 
 segno   empnoempstatus  restofdetails
 101   10001   T   ABC
 102   10001PRS
 103   10001XYE
 101   10002   T   ABC
 102   10002PRS
 103   10002XYE
 
 Could someone in the list pls let me know how to do the extracation?
 
 
 Regards
 Ron T
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
 

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN