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

[Solved]Many PS to One PDS


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
NaliniNaveen

New User


Joined: 13 Jul 2022
Posts: 4
Location: India

PostPosted: Wed Jul 13, 2022 5:40 pm
Reply with quote

Hello Everyone,

I have many PS say 50 PS files which I want to copy to a single PDS. Is it possible with IEBCOPY or with anyother utility?

Appreciate your response.
Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8651
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 13, 2022 5:55 pm
Reply with quote

Do all the sequential files have the same DCB -- record format, record length, DSORG?
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 899
Location: Bamberg, Germany

PostPosted: Wed Jul 13, 2022 7:49 pm
Reply with quote

Perhaps an Instream Proc is the best option. Please provide some more details.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1175
Location: Dublin, Ireland

PostPosted: Wed Jul 13, 2022 8:26 pm
Reply with quote

If all have the same DCB info, you could use IEBUPDTE prefixing each PS file with a control card specifying the PDS member name to be added e.g.

./ ADD MEMBER=member1
PS-file 1
./ ADD MEMBER=member2
PS-file 2

&c.

see : www.ibm.com/docs/en/zos/2.1.0?topic=statements-function-statement

Garry.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 628
Location: Denmark

PostPosted: Thu Jul 14, 2022 1:43 pm
Reply with quote

To expand on Garry's suggestion, if all have the save recfm/lrecl then you can use IEBUPDTE like so:

// EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DISP=SHR,DSN=your.pds
//SYSIN DD *
./ ADD NAME=member1
// DD DISP=SHR,DSN=your.first.ps
./ ADD NAME=member2
// DD DISP=SHR,DSN=your.second.ps

and so on and so forth.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 899
Location: Bamberg, Germany

PostPosted: Thu Jul 14, 2022 2:05 pm
Reply with quote

If you want to automate it, a PROC is more suitable, and also covers different input formats.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1611

PostPosted: Mon Jul 18, 2022 12:16 am
Reply with quote

Willy Jensen wrote:
To expand on Garry's suggestion, if all have the save recfm/lrecl then you can use IEBUPDTE like so:

// EXEC PGM=IEBUPDTE,PARM=NEW
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD DISP=SHR,DSN=your.pds
//SYSIN DD *
./ ADD NAME=member1
// DD DISP=SHR,DSN=your.first.ps
./ ADD NAME=member2
// DD DISP=SHR,DSN=your.second.ps

and so on and so forth.

This is fine, but only works for RECFM=FB,LRECL=80 icon_sad.gif
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1611

PostPosted: Mon Jul 18, 2022 12:32 pm
Reply with quote

Code:
//PS2PDS PROC QUAL=xxxx      Dataset qualifier
//NEWMEMBR EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD DISP=SHR,DSN=aaaa.bbbb.cccc.dddd.&QUAL
//SYSUT2   DD DISP=OLD,DSN=common.output.library(&QUAL)
//         PEND


If your output library is PDSE, then you can use DISP=SHR when writing to it.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1611

PostPosted: Mon Jul 18, 2022 3:42 pm
Reply with quote

For clarity (since there is no reaction)…

Code:
//jobname JOB jobparameters
//*
//PS2PDS PROC QUAL=xxxx      Dataset qualifier
//NEWMEMBR EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN    DD DUMMY
//SYSUT1   DD DISP=SHR,DSN=aaaa.bbbb.cccc.dddd.&QUAL
//SYSUT2   DD DISP=OLD,DSN=common.output.library(&QUAL)
//         PEND
//*
//DSN1 EXEC PS2PDS,QUAL=SAMPL1
//DSN2 EXEC PS2PDS,QUAL=SAMPL2
//DSN3 EXEC PS2PDS,QUAL=SAMPL3
//DSN4 EXEC PS2PDS,QUAL=SAMPL4
. . . . . . . .
//DSN99 EXEC PS2PDS,QUAL=SAMPL99
//
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 899
Location: Bamberg, Germany

PostPosted: Mon Jul 18, 2022 5:46 pm
Reply with quote

@sergeyken: This is what I was referring to.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 1611

PostPosted: Mon Jul 18, 2022 5:52 pm
Reply with quote

Joerg.Findeisen wrote:
@sergeyken: This is what I was referring to.

Nothing works here nowadays except ready-to-copy-and-paste solutions.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


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

PostPosted: Tue Jul 19, 2022 3:31 am
Reply with quote

It’s bit of a rush, give sometime for TS to come back with question or give try on suggestions made above.
Back to top
View user's profile Send private message
NaliniNaveen

New User


Joined: 13 Jul 2022
Posts: 4
Location: India

PostPosted: Fri Jul 22, 2022 6:29 pm
Reply with quote

Thank you everyone. I have created one as per @Sergeykan directed.

Thank you so much for all your support.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How can the SOC7 error be solved Mainframe Interview Questions 5
Search our Forums:

Back to Top