Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to append the records while writing?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to append the records while writing?
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    Post subject:
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    Post subject: Re: How to append the records while writing?
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    Post subject: Re: How to append the records while writing?
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    Post subject:
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    Post subject: Re: How to append the records while writing?
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us