Sign In

Dz Challenge: Tips and Techniques Got a great tip or technique to share?
z & A > Dz Challenge: Tips and Techniques > IBM Z/OS PDS to PS , Transfer to PC and restoring PDS from PS Backup of PC View modes: 
User avatar
Member
Member
hemanshuw - 6/8/2014 7:36:51 AM
   
IBM Z/OS PDS to PS , Transfer to PC and restoring PDS from PS Backup of PC

IBM Z/OS PDS to PS , Transfer to PC and restoring PDS from PS Backup of PC

IBM Z/OS PDS to PS , Transfer to PC and restoring PDS from PS Backup to PC
Leave a reply

We sometimes comes across the need to take a PDS dataset to PC and then restore this PDS to Mainframe .

Transfering Physical Sequential Dataset to PC is easy with Transfer options available with 3270 emulators , However when we want to transfer PDS members one at a time to PC becomes very tedious process , and one thinks of transferring some Utility , to transfer full PDS in one Single transfer

REXX utility has been written to transfer full Partition dataset ( all members ) to a Physical Sequential dataset , and IEBUPDATE control cards introduced at the beginning of each PDS Members contents for IEBUPDATE utility to restore back the PDS from Physical sequential Backup Copy

REXX Program to take a Copy PDS dataset to PS with changes for restoring back to PDS with IEBUPDATE utility program

REXX Program : – HLQ.REXX.EXEC(PDS2PS)

/* REXX */
say ‘please give pds name ‘
parse upper pull pds
say ‘please give PS name ‘
parse upper pull ps
updateCtrl = ‘./ ADD NAME=’
dummy = outtrap(“members.”,”*”)
address TSO
“LISTDS ‘”pds”‘ MEMBERS”
dummy = outtrap(“OFF”)
k = 0
do i = 7 to members.0
pds1 = “‘”pds”(“SPACE(members.i,0)”)’”
/* READ PDS MEMBER */
address TSO
“ALLOC F(inMem) DS(“pds1″) SHR”
“EXECIO * DISKR inMem (FINIS STEM inLine.”
“FREE F(inMem)”
do j = 1 to inLine.0
if j = 1 then
do
k = k + 1
outLine.k = updateCtrl||STRIP(members.i)
end
k = k + 1
outLine.k = inLine.j
end
end
outLine.0 = k
ps2 = “‘”ps”‘”
/* WRITE TO PS */
address TSO
“ALLOC F(outps) DS(“ps2″) SHR”
“EXECIO * DISKW outps (FINIS STEM outLine.”
“FREE F(outps)”
exit



EXECUTING REXX PROGRAM JCL TO PUT MEMBERS TO PS Dataset

PDS & PS DATASET as INPUT to REXX Program

allocate Physical sequential dataset with LRECL same as PDS dataset



//<JOBNAME>R JOB HWORAH,12345678,CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,
// MSGLEVEL=(1,1),TIME=(0,5)
//STEP1 EXEC PGM=IKJEFT01,PARM=’PDS2PS’
//* HLQ.REXX.EXEC CONTAINS MEMBER PDS2PS
//SYSEXEC DD DSN=HLQ.REXX.EXEC,DISP=SHR
//*—————————————————————-
//* PDS2PS CONTAINS THE REXX CODE
//* HLQ.REXX.JCL — PDS TO BE MADE PS
//* HLQ.REXX.JCL.PS — PS DATASET NAME FOR PDS
//*—————————————————————-
//SYSTSIN DD *
HLQ.REXX.JCL
HLQ.REXX.JCL.PS
/*
//SYSTSPRT DD SYSOUT=*
//*
//



RESTORING BACK FROM PS TO PDS- members

(ALLOCATE HLQ.REXX.RESTORE a PDS with same LRECL parameters by ISPF utility options )

//<JOBNAME>R JOB NAME,12345678,CLASS=A,MSGCLASS=A,NOTIFY=&SYSUID,
// MSGLEVEL=(1,1),TIME=(0,5)
//UPDATE1 EXEC PGM=IEBUPDTE
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DSN=HLQ.REXX.RESTORE,DISP=SHR
//SYSUT2 DD DSN=HLQ.REXX.RESTORE,DISP=SHR
//SYSIN DD DSN=HLQ.REXX.JCL.PS,DISP=SHR
//

This PDS to PS file can be transferred to PC using Emulator Transfer function ( HOST to PC & PC to HOST )

User avatar
Member
Member
hemanshuw - 6/9/2014 10:12:55 AM
   
RE:IBM Z/OS PDS to PS , Transfer to PC and restoring PDS from PS Backup of PC
Utility is based on further improvement to following references

1. http://mainframetipsntrick.blogspot.in/2010/09/rexx-tool-to-copy-all-pds-members-to-ps.html

2. http://destinationz.org/Community/Forums?forumid=7&fpage=2&threadid=111

1