JCL to print a set of records



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

JCL to print a set of records

Postby pablo » Tue Jul 08, 2008 4:56 pm

HI all,
I want to print set of records/lines from a file which is within a specific header and tailer and other records needs to be omitted. Is it possible to do it with the JCL without using any programs? I mean just using utilities.

Can anyone provide some help on this?
pablo
 
Posts: 5
Joined: Tue Jul 08, 2008 4:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to print a set of records

Postby MrSpock » Tue Jul 08, 2008 5:34 pm

Off the top of my head, I'm thinking TSO PRINTDS, SORT (DFSORT or SYNCSORT), SAS, CA-Easytrieve.
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: JCL to print a set of records

Postby pablo » Tue Jul 08, 2008 6:03 pm

Hi,
Thanks for the reply. I tried to do with sort, but of no help. I couldn't actually figure out the correct way to do it. so could someone please tell me in more precise on how to proceed with sort.

I wasn't aware of the tso command. Will try some google on it and see if it helps.
pablo
 
Posts: 5
Joined: Tue Jul 08, 2008 4:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to print a set of records

Postby Frank Yaeger » Tue Jul 08, 2008 8:34 pm

tried to do with sort, but of no help. I couldn't actually figure out the correct way to do it. so could someone please tell me in more precise on how to proceed with sort.


Based on what? You haven't given any real information as to what you're trying to do, so how can you expect anybody to tell you how to do it?

Show a good example of your input records (relevant fields only) and what you expect for output. Explain the "rules" for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of the relevant fields.
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 to print a set of records

Postby pablo » Wed Jul 09, 2008 1:15 pm

FORMAT OF RECORD - FB
LRECL - 132

SAMPLE RECORD
DAVID    CORTILAS   10 120 PR NR ........ 20010101
PABLO    ANGUITA    10 120 PR NR ........ 20010101
XAVIER   CHARLES    10 120 PR NR ........ 20010101

SUMMATION REPORT           <----- HEADER

PR 20010101  360 30 ........................ DAVID
MR 20010101  510 10 ........................ PABLO
CR 20010101  360 30 ........................ XAVIER
AR 20010101  360 30 ........................ DAVID

END OF REPORT            <----- TAIL

DAVID    CORTILAS   10 120 PR NR ........ 20010101
PABLO    ANGUITA    10 120 MR NR ........ 20010101
XAVIER   CHARLES    10 120 CR NR ........ 20010101

Note: Header and tail is just for notation. They are not present in the original file.

DESIRED OUTPUT:

SUMMATION REPORT           

PR 20010101  360 30 ........................ DAVID
MR 20010101  510 10 ........................ PABLO
CR 20010101  360 30 ........................ XAVIER
AR 20010101  360 30 ........................ DAVID

END OF REPORT


Hope this helps.
pablo
 
Posts: 5
Joined: Tue Jul 08, 2008 4:49 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL to print a set of records

Postby Frank Yaeger » Wed Jul 09, 2008 9:34 pm

Based on your example, this DFSORT job would do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/132)
//SORTOUT DD DSN=...  output file (FB/132)
//SYSIN    DD    *
  OPTION COPY
  INCLUDE COND=(4,1,CH,EQ,C'2')
  OUTFIL REMOVECC,
    HEADER1=('SUMMATION REPORT',/),
    TRAILER1=(/,'END OF REPORT')
/*
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