View previous topic :: View next topic
|
Author |
Message |
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
Hi,
We have a requirement to add a new column in ISPF Table. I have create new table with new column.
I want to copy data from my old table to new table.
Is it possible to unload data from old table to a ps file and load it to new table?
If anyone performed similar activity earlier, Please assist me.
Thanks. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Check with ISPF 3.16 (it has an EXPORT/IMPORT function). |
|
Back to top |
|
|
upendrasri
Active User
Joined: 28 Sep 2017 Posts: 124 Location: India
|
|
|
|
Hi Joerg,
I have tried with 3.16 but the problem is
1. My input table is having 37 colums
2. My output table is having 40 colums
When I tried export from input table to a dataset and import from this dataset to output table its copying data but its same as my input table and removing extra 3 colums.
My requirement is it should copy 37 colums and other 3 colums left as it is..
Thanks.. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 730 Location: Denmark
|
|
|
|
You should do something like this:
TBOpen old table
TBCreate new table with all fields
Copy old table to new table, populating the new fields. The simplest way to copy is:
TBQuery old-table rows(rownum)
do rownum
TBGet old-table
TBAdd new-table
end
TBend old table
TBCLOSE new-table - to create in library
rename old table member to backup
rename new table member to old name |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
It's easier using ISPF 3.16 here. You can even add the new fields to the export DSN and import the new structure. |
|
Back to top |
|
|
|