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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm

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