Record from input file as header in output file



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

Record from input file as header in output file

Postby Niha.R.Rai » Fri May 30, 2008 12:13 pm

I have two input files

F1:
*****************************************
XX12
*****************************************
F2:
*****************************************
A1234 Class
B1212 Class
D3440 School
C1234 Class
*****************************************

I want the output file to contain a header capturing '12' from File 1 and the detail records should be sorted from F2, the output should look like

F3:
*****************************************
Sequence : 12
A1234 Class
B1212 Class
C1234 Class
D3440 School
*****************************************

Does anyone know how to do this , can we use a join or something ? And I want it only in SYNCSORT or DFSORT as we are cannot use ICETOOL or ICEMAN .
Niha.R.Rai
 
Posts: 1
Joined: Fri May 30, 2008 12:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Record from input file as header in output file

 

Re: Record from input file as header in output file

Postby CICS Guy » Fri May 30, 2008 5:41 pm

Niha.R.Rai wrote:And I want it only in SYNCSORT or DFSORT as we are cannot use ICETOOL or ICEMAN .
Why can't you use them?
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Record from input file as header in output file

Postby Frank Yaeger » Fri May 30, 2008 9:08 pm

Niha,

Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTREC BUILD=(C'TARG,''',3,2,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=(1,11,CH,A)
  OUTFIL REMOVECC,
    HEADER1=('Sequence : ',TARG)
/*


And I want it only in SYNCSORT or DFSORT as we are cannot use ICETOOL or ICEMAN.


PGM=ICEMAN invokes DFSORT or SYNCSORT so you can certainly use it.

If you have DFSORT, then you have ICETOOL. ICETOOL has been part of DFSORT since 1991.
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post