Trailer Issue!
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: Trailer Issue! Author: Rahull PostPosted: Wed May 16, 2007 11:24 am
    —
Hi,

Please help me figure out how to obtain the below result:

Problem : I have an input file with header, detail and trailer record. File length is 80 byte and record layout for trailer is :
Code:

05  W-Z5BS-TRL-SEG-ID          PIC XXX  VALUE '999'
05  W-Z5BS-TRL-REC-COUNT       PIC 9(7).           
05  FILLER                     PIC X(70) VALUE SPAC

Trailer count = Number of detail records excluding header record.

I need to run a SORT utility and concatenate the above file with another flat file (LRECL = 80) with all detail records.

Final Output = Header + Detail records original + Detail records from second file + Trailer record (Updated with new record count).

Sample input File 1 :
Code:

51070516070515  (Header)
5128274967HOL20070603  (Detail 1)
5144358641HOL20070511  (Detail 2)
9990000002  (Trailer)

Input file 2:
Code:

5106027397HOA20070613 (Detail 3)
5106027398HOA20070613  (Detail 4)

Output file:
Code:

51070516070515  (Header)
5128274967HOL20070603  (Detail 1)
5144358641HOL20070511  (Detail 2)
5106027397HOA20070613  (Detail 3)
5106027398HOA20070613 (Detail 4)
9990000004  (Trailer)

#2:  Author: kolusuLocation: San Jose PostPosted: Wed May 16, 2007 12:13 pm
    —
Rahull,

Try this job.

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD DSN=Your input file 1,
//            DISP=SHR
//         DD DSN=Your input file 2,
//            DISP=SHR
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  OMIT COND=(1,3,CH,EQ,C'999')                 
  SORT FIELDS=COPY                             
  OUTFIL REMOVECC,                             
  TRAILER1=('999',COUNT-1=(M11,LENGTH=7),80:X)
/*                                             


Hope this helps...

Cheers

Kolusu

#3:  Author: Nic CloustonLocation: At Home PostPosted: Wed May 16, 2007 12:55 pm
    —
Quote:

I need to run a SORT utility

So why is this posted in the JCL section and not in the Utilities section? I was looking forward to a nice juicy JCL problem to try resolve Mad

#4:  Author: CraigGLocation: Viginia, USA PostPosted: Wed May 16, 2007 2:34 pm
    —
Nic Clouston wrote:
Quote:

I need to run a SORT utility

So why is this posted in the JCL section and not in the Utilities section? I was looking forward to a nice juicy JCL problem to try resolve Mad


Some people don't know the difference between JCL and program (utility)control cards.

#5:  Author: kolusuLocation: San Jose PostPosted: Wed May 16, 2007 6:23 pm
    —
Quote:

So why is this posted in the JCL section and not in the Utilities section? I was looking forward to a nice juicy JCL problem to try resolve


Nic,

He is one of the Elite posters who does not post a feedback for the solutions he received in here. we will just be remembered when he gets another problem, till then .... Evil or Very Mad Evil or Very Mad

Kolusu



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group