View previous topic :: View next topic
|
Author |
Message |
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
Hi All,
i want to append the record to the same member,
in otherwords, read from different file and write into the single output.
Can anyone help me.
Regards,
ram |
|
Back to top |
|
|
Redrose Currently Banned New User
Joined: 06 Mar 2006 Posts: 19
|
|
|
|
Dear Ram ,
You can read records from different files and can append them to a single output dataset. Follow the below steps,
1. Allocate your Output Dataset in MOD mode,
E.g., "ALLOC FI(DDName) DS('"DSName"') MOD"
2. Read records from input file to a Stem variable
3. Write the whole Stem to the above mentioned file in STEP 1.
E.g., "EXECIO" InStem.0 "DISKW DDName (STEM InStem."
(Note that, I didn't close the file with FINIS Option)
4. Repeat Steps 2 & 3, until all your input files are over. Please note that
if you tend to use the same Stem variable drop all the elements before
using it again. Eg., Drop InStem.
5. Finally close the output file as below,
"EXECIO 0 DISKW DDName (FINIS"
IF RC = 0 THEN
"FREE FI(DDName)" /* Frees your Output Dataset)
Hope it helps ,
Yours
Ramanan R
-------------------------------------------------------------------------------------
Winners Don't Do Different Things, They Do Things Differently
- Shiv Kehra
------------------------------------------------------------------------------------- |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
Just make sure that the type of dataset that's being written to supports a DISP=MOD allocation. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
Thanks ramanan...
Kevin
i think it is not necessay it should be MOD, it is working fine for disp=shr from the above suggest method.
Thanks Kevin. |
|
Back to top |
|
|
Redrose Currently Banned New User
Joined: 06 Mar 2006 Posts: 19
|
|
|
|
Hi Ram ,
Ya, it can be in SHR mode also, but make sure no one access your output dataset while your EXEC runs. It may cause your EXEC to abend.
Regards,
Ramanan R |
|
Back to top |
|
|
Kevin
Active User
Joined: 25 Aug 2005 Posts: 234
|
|
|
|
The original post stated:
Quote: |
i want to append the record to the same member...
|
which made it sound like the O/P wanted to append to a PDS member. I was just pointing out that that's not allowed within TSO. |
|
Back to top |
|
|
|