Page 1 of 1

JCL to print a set of records

PostPosted: Tue Jul 08, 2008 4:56 pm
by pablo
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?

Re: JCL to print a set of records

PostPosted: Tue Jul 08, 2008 5:34 pm
by MrSpock
Off the top of my head, I'm thinking TSO PRINTDS, SORT (DFSORT or SYNCSORT), SAS, CA-Easytrieve.

Re: JCL to print a set of records

PostPosted: Tue Jul 08, 2008 6:03 pm
by pablo
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.

Re: JCL to print a set of records

PostPosted: Tue Jul 08, 2008 8:34 pm
by Frank Yaeger
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.

Re: JCL to print a set of records

PostPosted: Wed Jul 09, 2008 1:15 pm
by pablo
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.

Re: JCL to print a set of records

PostPosted: Wed Jul 09, 2008 9:34 pm
by Frank Yaeger
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')
/*