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

How to copy the contents of a PDS to PS File


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

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 4:40 pm
Reply with quote

Could any one let me know how to copy the contents of all the members inside the PDS(without listing out the members inside the PDS in the job) to a flat file.

Where the flat file as ouput should consist of all the data inside the PDS members to be concatenated inside.

Could any one come up with a sample job to do this !!
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Oct 16, 2007 4:47 pm
Reply with quote

9.0 IEBPTPCH (Print-Punch) Program from the DFSMS/MVS V1R5 Utilities.

1.35 PRINTDS Command from the z/OS V1R7.0 TSO/E Command Reference.
Back to top
View user's profile Send private message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 4:52 pm
Reply with quote

Could you please send me a sample program which uses IEBPTPCH.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Oct 16, 2007 5:48 pm
Reply with quote

There's one here in this previous topic.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 16, 2007 6:19 pm
Reply with quote

why not use the 3.3 panel?
Back to top
View user's profile Send private message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 6:33 pm
Reply with quote

3.3 is for copy 'pds to pds' or 'ps to ps' but not for 'all pds member to a single ps'.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Oct 16, 2007 6:37 pm
Reply with quote

Huh?? icon_confused.gif

ISPF 3.3 is "3 Move/Copy Move, or copy members or data sets", which can be PDS to PDS, PDS to SEQ, SEQ to PDS.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Oct 16, 2007 6:38 pm
Reply with quote

naga,

Quote:
3.3 is for copy 'pds to pds' or 'ps to ps' but not for 'all pds member to a single ps'.


Are you sure?

Quote:
dbzTHEdinosauer wrote:

why not use the 3.3 panel?


Yes, 3.3 can be used to copy PDS to PS.
Back to top
View user's profile Send private message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 6:46 pm
Reply with quote

Thanks kevin,
3.3 option worked. I was able to copy all the content of the PDS members to a single flat file.


Thank you !!!!!!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Oct 16, 2007 6:50 pm
Reply with quote

Quote:
3.3 is for copy 'pds to pds' or 'ps to ps' but not for 'all pds member to a single ps'.


WRONG, I just tested it,

it works, it will simply copy to a sequential datasets all the members selected - without any separator.

Just like concatenating each member as a dd of a IEBGENER step

It might be useless if used for pds containing source programs,
but if the pds contained just data to be concatenated, it will work
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Oct 16, 2007 6:51 pm
Reply with quote

I thought your original requirement was to be able do this in batch without having to code a program. No?
Back to top
View user's profile Send private message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 6:53 pm
Reply with quote

But before using this 3.3 option i created an empty flat file and then gave for 3.3 option to copy.

If we didnt define before 3.3, then it is trying to create a new PDS and copy all the content to those PDS members to new PDS members.
Back to top
View user's profile Send private message
NAGARJUN CARALAPATI

New User


Joined: 09 Oct 2007
Posts: 22
Location: chennai.India

PostPosted: Tue Oct 16, 2007 6:54 pm
Reply with quote

Yes,
our original requirement was to be able do this in batch without having to code a program.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Tue Oct 16, 2007 7:00 pm
Reply with quote

Quote:
If we didnt define before 3.3, then it is trying to create a new PDS and copy all the content to those PDS members to new PDS members.


Maybe You were pounding too fast on Your keyboard,
or You were not looking at the panel' s text

When You specify a non existent dataset, ISPF will ask
how to allocate the target dataset,
a reply with "1" will allocate with the same caractheristics of the source,
a reply with "2" will ask for the allocation parameters
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Oct 19, 2007 12:53 pm
Reply with quote

If you have FILEAID here's an example that works

//UPD EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=INPUT.PDS,
// DISP=SHR
//DD01O DD DSN=OUTPUT.DSN,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(500,100),RLSE)
//SYSIN DD *
*
$$DD01 COPY MEMBERS=ALL,OUT=0
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Jul 15, 2009 1:20 am
Reply with quote

Hi,

I want to do exactly reverse!!!

I want to copy the flat file to PDS member.

What is a procedure to do this?

Thanks,
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Jul 15, 2009 1:56 am
Reply with quote

Is there a reason you replied to an old message instead of creating a new one?

Do you want to copy the flat file to one PDS member. If so you may use 3.3, IEBGENER, ICEGENER, IDCAMS, or other programs.

If you want the flat file to be split into several PDS members, then we need to know how to detect when one member ends and the next starts. It could easily help to know how this file was created.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Jul 15, 2009 1:43 pm
Reply with quote

It depends on how the flat file was created. Without knowing how it was created we can to tell you how to restore it
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Jul 15, 2009 8:10 pm
Reply with quote

One has other options such as choose the members to be copied the columns to be copied and many...


//IEBPTPCH EXEC PGM=IEBPTPCH
//SYSUT1 DD DSN=file.file1,DISP=SHR
//SYSUT2 DD DSN=file.file2,DISP=(OLD,CATLG,DELETE)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT TYPORG=PO,MAXFLDS=1
RECORD FIELD=(80)
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jul 15, 2009 8:17 pm
Reply with quote

rahulbank, the post was for going from a flat file to a PDS. Your JCL is going from a PDS to a flat file. Exactly how does this help, since you're doing completely the opposite of what was asked?

sagar, as was pointed out by earlier posts, there's a lot of possible ways to do what you're asking but the tool used depends partly upon the flat file's characteristics. Unless you provide us more, all we can do is say yes it can be done but the specific tool depends upon the file.
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Jul 15, 2009 8:20 pm
Reply with quote

This was the original question:


Could any one let me know how to copy the contents of all the members inside the PDS(without listing out the members inside the PDS in the job) to a flat file.


My intention was just to help the person who has asked the original question incase he has still not found the solution to this.
Back to top
View user's profile Send private message
rahulbank

New User


Joined: 25 Sep 2008
Posts: 66
Location: Bengaluruuuuuu

PostPosted: Wed Jul 15, 2009 8:22 pm
Reply with quote

Sorry Now I realize the oringinal question was asked way back in time...

Apologies....
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 15, 2009 8:26 pm
Reply with quote

edit the pds member, enter 'A' at the line after which you want the new data positioned and enter COPY on the commandline. Depress ENTER.
fill out the panel.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Wed Jul 15, 2009 8:54 pm
Reply with quote

Actually I tried using IDCAMS as follows:

Code:
//PS010    EXEC  PGM=IDCAMS                           
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSUDUMP DD SYSOUT=*                               
//INFILE   DD DSN=PRGSD1.PCDATF.ADHERIS.TEMP,DISP=SHR
//OUTFILE  DD DSN=PRGSD1.CTL.LIB(PCAD004Z),           
//            DISP=(NEW,CATLG,DELETE),               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),   
//            UNIT=CARDA,                             
//            SPACE=(CYL,(500,500),RLSE)             


but it says 'PRGSD1.CTL.LIB' already exists.

I want tp copy the contents of flat file into the member PCAD004Z,
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Wed Jul 15, 2009 8:56 pm
Reply with quote

Use DISP=OLD for guaranteed results, or DISP=SHR if you're sure nobody else can be updating the PDS at the same time. DISP applies to the data set, not to the member -- as many have discovered the hard way by attempting to code DISP=(OLD,DELETE) to get rid of a member (the data set goes away instead).
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 4
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts how to eliminate null indicator value... DB2 7
No new posts Use Copy Utility DB2 7
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top