Extracting source code from a PDS



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Extracting source code from a PDS

Postby jeroc » Tue Sep 02, 2008 6:43 pm

Hello,

I need to extract program source code from a library (in fact a PDS) to ASCII text files (one text file per program). My goal is to transfer the program source code on a Windows workstation.
Could you explain me how to proceed and if you have some examples of JCL doing this, then it could be helpful.

Thanks in advance
jeroc
 
Posts: 22
Joined: Tue Sep 18, 2007 2:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extracting source code from a PDS

 

Re: Extracting source code from a PDS

Postby dick scherrer » Tue Sep 02, 2008 7:13 pm

Hello,

The easiest way to do this is to sign onto the mainframe ftp using the ftp client on your desktop, set the transmission to ascii, specify the target directory on the pc, highlight the members you want to transfer to your pc, and click the transfer. Each member will be brought to the pc as a separate file and will be stored in the directory you are pointing to.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Extracting source code from a PDS

Postby jeroc » Tue Sep 02, 2008 9:10 pm

Ok, this is interesting. But if I want to extract the members by using a utility, what is the utility to use? IEBCOPY, IEBGENER...?
jeroc
 
Posts: 22
Joined: Tue Sep 18, 2007 2:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extracting source code from a PDS

Postby dick scherrer » Tue Sep 02, 2008 10:20 pm

Hello,

You can use those or your sort or several other utilities. . . .

If you do, you will have to create an output file for each member (assuming you want individual files on the target system).

If you use the ftp client you already have (which you will have to use anyway once you create the files on the mainframe - you would still need to ftp them), you can merely click on the members you want to download directly and create no intermediate files.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Extracting source code from a PDS

Postby jeroc » Tue Sep 02, 2008 10:36 pm

I want to automate the extraction and perform it regularly. This is why I thought to use a JCL. However, I noted your suggestion because it is an interesting way for occasional and manual usages.
Do you have an example of such a JCL?

Thanks
jeroc
 
Posts: 22
Joined: Tue Sep 18, 2007 2:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extracting source code from a PDS

Postby MrSpock » Wed Sep 03, 2008 12:03 am

jeroc wrote:Do you have an example of such a JCL?


I'm sorry, but a job that does what exactly?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Extracting source code from a PDS

Postby dick scherrer » Wed Sep 03, 2008 12:38 am

Hello,

What i suggested requires no jcl. It is done from the desktop,

If you want to pull a set of members repeatedly, you could write a batch script on the pc that connects to the mainframe ftp and downloads all of the members you want. Again, there would be no jcl.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Extracting source code from a PDS

Postby jeroc » Wed Sep 03, 2008 1:19 pm

Hello MrSpock,

I'm looking for a JCL that extract the members of a PDS into separate files. For instance, in order to create a file per program from a source library.

dick Scherrer suggested me to use FTP but I also want to know if it possible to use a JCL.

Thanks in advance.
Jeroc
jeroc
 
Posts: 22
Joined: Tue Sep 18, 2007 2:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extracting source code from a PDS

Postby jeroc » Wed Sep 03, 2008 1:27 pm

Sorry, my previous question is not exactly what I'm looking for.

I would like to have a JCL that creates a file containing all the members of a PDS in 1 file (in order to download it onto a Windows pc) but each file must be separate by a banner like MEMBER NAME=<member name>.

For example, if the PDS contains the source of 3 programs, the extraction file should be:
MEMBER NAME=program1
source code of prog1
MEMBER NAME=program2
source code of prog2
MEMBER NAME=program3
source code of prog3
jeroc
 
Posts: 22
Joined: Tue Sep 18, 2007 2:11 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Extracting source code from a PDS

Postby shagnwrx » Fri Sep 05, 2008 2:45 am

jeroc, You may be going about this the long way around.

We have several processes here where we ship complete PDS's to workstations or unix boxes (in ASCII format). The way we tackeld it was to use JCL to invoke FTP. This would require that you setup an FTP server on your windows machine. You would issue the LCD to connect to the PDS on the mainframe, and use CD to identify the directory on your target workstation. Do an MPUT to the target workstation or server from the mainframe. It will place the members as seperate ASCII files in the directory that you identified with the LCD command. One clean step and no having to manipulate a flat file into seperate files on your workstation.

Just for reference, here's what the JCL would look like.... In the PARM field on the EXEC card of the JCL, you put the IP Addr of the workstation you sending to. Also, before you run anything similar to this sample, remove the comments from of the SYSIN statements.

//FTPSTP1  EXEC PGM=FTP,REGION=2M,                   
//     PARM='10.0.0.1'             <=======  CHANGE TO THE IP ADDRESS OF TARGET WORKSTATION               
//STEPLIB  DD  DSN=TCPIP.SEZALOAD,DISP=SHR           
//SYSFTPD  DD  DSN=TCPIP.SEZAINST(FTPSDATA),DISP=SHR
//SYSMDUMP DD  SYSOUT=A                             
//SYSPRINT DD  SYSOUT=*                             
//OUTPUT   DD  SYSOUT=*                             
//INPUT    DD  *                                     
userid password    /* Userid and passord you've set up in the FTP software on your workstation */                                 
cd d:\TargetDirectory\       /*connects to the directory on the workstation */
lcd NAME.OF.THE.MAINFRAME.PDS         /*connects to the PDS on the mainframe*/
noprompt                                          /* without this, it would be a pain in the butt */
mput *                                              /* this means Multi-put, it will send every member of the PDS to the workstation */   
quit
/*
//
shagnwrx
 
Posts: 3
Joined: Wed Sep 03, 2008 2:29 am
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post