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

Duplicating records in a PDS memebr/Inserting records in mem


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
imcoolleo

New User


Joined: 04 Apr 2006
Posts: 8

PostPosted: Mon Sep 16, 2019 3:32 pm
Reply with quote

Duplicating records in a PDS memebr/Inserting records in member

Hi All,

How can we update all PDS members to duplicate some entry?

Like I have a PDS with mupltiple members like below

VIEW XXX.XXX.XXXX.WORKPDS1(MEMBER02) - 01.0
Command ===> Sc
****** ***************************** Top of Data ***************
000001 .
000002 TRANSFER ELEMENT 'ZTEST'
000003 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000004 TYPE 'RJCJCL' STAGE P
000005 OPTIONS CCID 'ADMIN' COMMENTS "ADMIN TEST" JUMP
000006 .
000007 .
000008 TRANSFER ELEMENT 'ZTEST2'
000009 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000010 TYPE 'RJCJCL' STAGE P
000011 OPTIONS CCID 'ADMIN' COMMENTS "ADMIN TEST" JUMP

I want to repeat every below entry just after it.
FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
TYPE 'RJCJCL' STAGE P

So that output will look like:

VIEW XXX.XXX.XXXX.WORKPDS1(MEMBER02) - 01.0
Command ===> Sc
****** ***************************** Top of Data ***************
000001 .
000002 TRANSFER ELEMENT 'ZTEST'
000003 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000004 TYPE 'RJCJCL' STAGE P
000005 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000006 TYPE 'RJCJCL' STAGE P
000007 OPTIONS CCID 'ADMIN' COMMENTS "ADMIN TEST" JUMP
000008 .
000009 .
000010 TRANSFER ELEMENT 'ZTEST2'
000011 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000012 TYPE 'RJCJCL' STAGE P
000013 FROM ENVIRONMENT "PRD" SYSTEM 'ZZ' SUBSYSTEM 'STD'
000014 TYPE 'RJCJCL' STAGE P
000015 OPTIONS CCID 'ADMIN' COMMENTS "ADMIN TEST" JUMP

Kindly suggest.
Thanks/
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Mon Sep 16, 2019 4:48 pm
Reply with quote

Do not post the same questions in two sections , it won’t help you to get any different answers. Second use code tags.
ibmmainframes.com/viewtopic.php?p=347301#347301

Moderator, Please lock this topic.
Back to top
View user's profile Send private message
imcoolleo

New User


Joined: 04 Apr 2006
Posts: 8

PostPosted: Mon Sep 16, 2019 5:40 pm
Reply with quote

If you will look closely questions are in different format. One is for COBOL experts and other for DFSORT experts. Don't you think they can be addressed by different groups. Look closely again.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Sep 16, 2019 6:06 pm
Reply with quote

You are posting the sme question - how do I copy 2 lines after a certain line, that line appearing several times in the dataset or member.

You have been a member for 11 years so you should know that data and code should be posted using the code tags.

And I do not know why you want to make your Endevor control cards invalid.

The DFSort topic will be deleted.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Mon Sep 16, 2019 6:06 pm
Reply with quote

If you get DFSORT solution then how difficult that to apply it here and if you can not then Beginners Forum is the best place to put in ?

As far COBOL solution is concerned, isn’t it straight forward to identifying such records , Save it locally and write twice and move on with next record and repeat the same until EOF?
Back to top
View user's profile Send private message
imcoolleo

New User


Joined: 04 Apr 2006
Posts: 8

PostPosted: Tue Sep 17, 2019 9:38 am
Reply with quote

@Nic : Sorry about the code tags, I am using this forum after a long time.
@Rohit: It worked as per your suggestion. Thanks.
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 -> COBOL Programming

 


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 avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top