Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Storing the output of sql in a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Storing the output of sql in a dataset
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    Post subject:
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    Post subject:
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    Post subject:
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: 1226
Location: Israel

PostPosted: Mon Aug 03, 2009 5:46 pm    Post subject:
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    Post subject: Hi
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

Site Director


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

PostPosted: Mon Aug 03, 2009 8:38 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us