Appending to the exsting record



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

Appending to the exsting record

Postby pady21907 » Fri Jan 15, 2010 6:48 pm

Hello All,

I have a requirement as bellow -

1. file1 of 160 length
2. file2 of 7 length
3. file3 is required of 167 length
I have to append the record1 of file2 to the record1 of file1 i.e. the third file will have the record1 of file1 + record1 of file2
eg.

file1         
12345       
abcd         

file2
999   
xyz   


then file3 should be as below-

file3

12345          999
abcd           xyz


All thihs should be acheived through JCL/Sort.

Looking forward to your reply.
pady21907
 
Posts: 1
Joined: Fri Jan 15, 2010 6:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Appending to the exsting record

 

Re: Appending to the exsting record

Postby Frank Yaeger » Fri Jan 15, 2010 10:28 pm

If you have z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), you can use a DFSORT JOINKEYS job like the following to do what you asked for. If you have DFSORT, but don't have the Nov, 2009 PTF, ask your System Programmer to install it (it's free).

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/160)
//IN2 DD DSN=...  input file2 (FB/7)
//SORTOUT DD DSN=...  output file (FB/167)
//SYSIN    DD    *
  JOINKEYS F1=IN1,FIELDS=(168,8,A),SORTED,NOSEQCK
  JOINKEYS F2=IN2,FIELDS=(8,8,A),SORTED,NOSEQCK
  REFORMAT FIELDS=(F1:1,160,F2:1,7)
  OPTION COPY
/*
//JNF1CNTL DD *
  INREC OVERLAY=(168:SEQNUM,8,ZD)
/*
//JNF2CNTL DD *
  INREC OVERLAY=(8:SEQNUM,8,ZD)
/*
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