View previous topic :: View next topic
|
Author |
Message |
shanudarling Warnings : 1 New User
Joined: 20 Dec 2006 Posts: 55 Location: noida
|
|
|
|
I have 2 sequential files and both have the same record length.
File A contains some data
File B contains notes
My task is copy the contents of file B into file A at the end of file A.
Both the files cannot be sorted as we cannot change the sequence of records.
File A
Code: |
1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|
|
File B
Code: |
AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324
|
Expected Output file -
Code: |
1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|
AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324
|
I am exploring if this can be done by a JCL only?
Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
No, because NOTHING can be done "with a JCL only".
Suggest you concatenate the 2 input files and write a new output containing all of the records.
You can use your sort to do this. |
|
Back to top |
|
|
shanudarling Warnings : 1 New User
Joined: 20 Dec 2006 Posts: 55 Location: noida
|
|
|
|
Merged the files using the below jcl. Worked fine.
Code: |
//STEP0001 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=DTEM.TEST.DATA.A,DISP=SHR
// DD DSN=DTEM.TEST.DATA.B,DISP=SHR
//SORTOUT DD DSN=DTEM.TEST.DATA.C,DISP=SHR
//SYSIN DD *
OPTION COPY
/*
|
[/code] |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
you have copied/concatenated 2 files, not MERGED 2 files.
Gerry |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Merged the files using the below jcl. Worked fine. |
Yes, it worked because you did as suttested - concatenate the 2 input files.
Regardless of your improper use of the word "merge" you did NO merge. MERGE says there is a sequence to the data (some key(s) and typically data from the multiple files is interleaved by the merge process.
After doing this for more than 5 years, you should be using the correct terminology. Every time. |
|
Back to top |
|
|
|