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

Storing the output of sql in a dataset


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

New User


Joined: 09 Oct 2005
Posts: 22
Location: INDIA

PostPosted: Mon Aug 03, 2009 4:18 pm
Reply with quote

Hi,

I have fired a sql using the job, however i am not able to store the result into dataset using the job.

I am trying the below, however the job abends with CODE=4039


//SYSTSPRT DD SYSOUT=Q
//SYSABOUT DD SYSOUT=Q
//SYSPRINT DD DSN=DBA.CNTL(SQLREP),DISP=SHR
//SYSOUT DD SYSOUT=Q
//SYSTSIN DD *


Please help, how could i identify the recordlengen and blk size of the dataset to store SQL results
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Mon Aug 03, 2009 5:14 pm
Reply with quote

You can specify LRECL and BLKSIZE = 0 (if its for testing purposes).

The LRECL would depend on your result set. So if you could calculate the total length of your result set, you'll get the record length.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Mon Aug 03, 2009 5:15 pm
Reply with quote

By the way, can you post your error messages here. Please use the code tag.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Aug 03, 2009 5:44 pm
Reply with quote

By the way you could tell us what program you are using and show us the proc that you are using!
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Mon Aug 03, 2009 5:46 pm
Reply with quote

CNTL files are usualy defined with RECFM=FB and LRECL=80
print files are mostly defined with RECFM=FBA and LRECL=133

These are standard conventions. Please respect them.

Do not place cobol programs or COPY members in the CNTL library,
do not put JCLs in the COBOL library, do not put listings in the CNTL, and so on.

Have a different library for each use.
Back to top
View user's profile Send private message
navneet.dewangan

New User


Joined: 09 Oct 2005
Posts: 22
Location: INDIA

PostPosted: Mon Aug 03, 2009 5:53 pm
Reply with quote

Many thanks for reminding the rules. Please pass me the reference document if you have any for this consideration.

Thanks a lot
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Aug 03, 2009 8:38 pm
Reply with quote

Hello,

Quote:
Please pass me the reference document if you have any for this consideration.
There is no general reference document. Library content and naming conventions are sompletely site-specific. Whatever the convention is on your system, you should follow it.

Suggest you experiment with creating a new dataset for the sql output rather than potentially walking on some existing library. . .
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top