satyapn9
New User
Joined: 08 Oct 2010 Posts: 27 Location: India
|
|
|
|
Hello,
I have an input file of length 80 and has 50 records in it. I would like to write an output file of length 160 and it should contain the records like below:
<------80----> <----80---->
______________________
1 |--------------|----------------| 26
2 |--------------|----------------| 27
3 |--------------|----------------| 28
4 |--------------|----------------| 29
.. |--------------|----------------| ..
.. |--------------|----------------| ..
.. |--------------|----------------| ..
25|________|__________| 50
as in the picture..... first 25 records should be written to first half and second 25 should be written to second half of the output file.
can you please guide me how to code this
Thank you,
Regards,
Satya Prasad Nimmakayala. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. Note that the input file is used for //IN1 and //IN2.
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file
//IN2 DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(81,2,A),SORTED,NOSEQCK
JOINKEYS F2=IN2,FIELDS=(81,2,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,80,F2:1,80)
OPTION COPY
/*
//JNF1CNTL DD *
OPTION STOPAFT=25
INREC OVERLAY=(81:SEQNUM,2,ZD)
/*
//JNF2CNTL DD *
OPTION SKIPREC=25
INREC OVERLAY=(81:SEQNUM,2,ZD)
/*
|
|
|