JCL SORT on PS file



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL SORT on PS file

Postby Brindha » Thu Mar 11, 2010 1:03 pm

Hi,

I have one PS file which is a report kind of file. From that file i need to find one string and based on that i need to extract the next line.

Example:
----------------- TRIGGERED BY JOBS/DATASETS/NETWORKS ----------
JOB=FT@D0111 SCHID=234 QTM=0000 LEADTM=0000 SUBMTM=0000

I need to find the string '----------------- TRIGGERED BY JOBS/DATASETS/NETWORKS ----------' and write the next record in out put file.

Output file should contain

JOB=FT@D0111 SCHID=234 QTM=0000 LEADTM=0000 SUBMTM=0000

Thanks in advance for your help.

Brindha.
Brindha
 
Posts: 4
Joined: Thu Mar 11, 2010 12:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby Bill Dennis » Thu Mar 11, 2010 9:18 pm

Is it always just one line following your trigger? Never multiples?
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby Frank Yaeger » Fri Mar 12, 2010 12:10 am

Brindha,

What is the RECFM and LRECL of your input file?
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: JCL SORT

Postby Brindha » Fri Mar 12, 2010 11:55 am

Hi,

yes.. Through out the file I need to find and write the output, its a multiples.

RECFM =FBA, LRECL=100

Thanks!!
Brindha
 
Posts: 4
Joined: Thu Mar 11, 2010 12:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby Frank Yaeger » Fri Mar 12, 2010 10:36 pm

Here's a DFSORT job that will do what you asked for. Since your input file has RECFM=FBA, I assumed the string you're looking for starts in position 2 (after the carriage control character).

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FBA/100)
//SORTOUT DD DSN=...  output file (FBA/100)
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,64,CH,EQ,
  C'----------------- TRIGGERED BY JOBS/DATASETS/NETWORKS ----------'),
    RECORDS=2,PUSH=(101:SEQ=1))
  OUTFIL INCLUDE=(101,1,CH,EQ,C'2'),BUILD=(1,100)
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: JCL SORT

Postby Brindha » Wed Mar 17, 2010 3:43 pm

Could you please explain the syntax and I am getting the syntax error.
Brindha
 
Posts: 4
Joined: Thu Mar 11, 2010 12:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SORT

Postby Frank Yaeger » Wed Mar 17, 2010 10:23 pm

I am getting the syntax error.


Please show the //SYSOUT messages you received so I can see what error you're getting. I'm not a mindreader. (The control statements work fine when I run them with DFSORT.)

DFSORT's WHEN=GROUP function is described in detail at:

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

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
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post