IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to append the records while writing?


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Mon Sep 25, 2006 5:31 pm
Reply with quote

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
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Mon Sep 25, 2006 6:18 pm
Reply with quote

Dear Ram icon_smile.gif ,

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 icon_biggrin.gif ,

Yours
Ramanan R
-------------------------------------------------------------------------------------
Winners Don't Do Different Things, They Do Things Differently
- Shiv Kehra
-------------------------------------------------------------------------------------
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Mon Sep 25, 2006 7:09 pm
Reply with quote

Just make sure that the type of dataset that's being written to supports a DISP=MOD allocation.
Back to top
View user's profile Send private message
ramfrom84

New User


Joined: 23 Aug 2006
Posts: 93
Location: chennai

PostPosted: Mon Sep 25, 2006 7:28 pm
Reply with quote

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
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Sep 26, 2006 11:49 am
Reply with quote

Hi Ram icon_smile.gif ,

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
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Tue Sep 26, 2006 5:55 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top