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: 1208
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top