Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy Dataset to pds without using Copy

Status
Not open for further replies.

daryani

Programmer
Aug 28, 2003
5
How do I copy a sequential file to PDS . Currently I am using
copy "dataset" "pds(member-name)" nonum but this fails if the desination pds is in share mode. Could you please help me how can I do this?





 
Hi Daryani,

Try this one :

/* REXX */

ADDRESS TSO


FICH = The name of your sequential file

WHY = ' ALLOC BIB1'

"ALLOC F(BIB1) DA('"FICH"') SHR"
IF RC ^= 0 THEN SIGNAL PB

WHY = ' ALLOC BIB2'

"ALLOC F(BIB2) DA('XXXX.XXXX.XXXX(MEMBER_Name)') SHR"
IF RC ^= 0 THEN SGNAL PB


WHY = ' READ BIB1'

"EXECIO * DISKR BIB1 (STEM DATA. FINIS "
IF RC ^= 0 THEN SIGNAL PB

WHY = ' WRITE BIB2'

"EXECIO * DISKW BIB2 (STEM DATA. FINIS"
IF RC ^= 0 THEN SIGNAL PB

"FREE F(BIB1 BIB2)"

SIGNAL FIN

PB:
SAY 'PROBLEM DURING THE RUNNING CODE :'RC !! WHY
FIN:

EXIT


If your file is to long you have to read it record by record like this :


"EXECIO 1 DISKR BIB1 (STEM DATA. "
ret = rc

DO WHILE (RET = 0)

"EXECIO" 1 "DISKW BIB2 (STEM DATA. "


"EXECIO 1 DISKR BIB1 (STEM DATA. "

END

"EXECIO" 0 "DISKR BIB1 (FINIS)"
"EXECIO" 0 "DISKR BIB2 (FINIS)"

EXIT



If your records length are to long you should cut them
before you write them.



Regards,

Tzu
 
IEBGENER, ICEGENER, DFSORT or SYNCSORT.

Using IEBGENER:
Code:
//copy exec pgm=iebgener
//sysut1   dd disp=shr,dsn=the.seq.data.set
//sysut2   dd disp=shr,dsn=your.po.data.set(member)
//sysprint dd sysout=*
//sysin    dd dummy


Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top