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

Copy Records from a table having 47 fields into a file


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rsm_deepak

New User


Joined: 06 Apr 2005
Posts: 30
Location: visakhapatnam

PostPosted: Tue Jul 18, 2006 7:44 pm
Reply with quote

Here i just want to copy the records of a table having 47 fields into a new file.
My problem is that when i am declaring a cursor whether i have to declare all the 47 fields in the cursor or there is any other easy method.
Back to top
View user's profile Send private message
anamikak

New User


Joined: 10 May 2006
Posts: 64
Location: Singapore

PostPosted: Tue Jul 18, 2006 9:55 pm
Reply with quote

try out unload utility
Back to top
View user's profile Send private message
red_roses

New User


Joined: 31 Oct 2005
Posts: 27

PostPosted: Tue Jul 18, 2006 10:36 pm
Reply with quote

anamikak has a good suggestion, if u only want the recs on a file and no processing for it then its a safer way to ues the unload utiliy,

search the forumn for the exact jcl, someone had posted it jsut a few days ago
Back to top
View user's profile Send private message
ravi17s
Warnings : 1

New User


Joined: 15 Aug 2003
Posts: 57

PostPosted: Wed Jul 19, 2006 5:13 pm
Reply with quote

Yes u can use UNLOAD utility.

But if you want to go for a cursor,Just declare it as

EXEC SQL DECLARE C1 CURSOR FOR SELECT * FROM TABLE NAME:


Thanks,
Ravi....
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1209
Location: Bangalore,India

PostPosted: Fri Jul 21, 2006 4:46 pm
Reply with quote

Yeap Ravi is right but while fetchin the row from the cursor u have to give all 47 variable i.e

fetch cursor1 into :table1.field1,
:table1.field2,
:table1.field3,
....................................................
....................................................
....................................................
....................................................
:table1.field47
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts count contained values of several col... DB2 5
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
Search our Forums:


Back to Top