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
 

 

output of the query intp dataset not SYSPRINT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Thu May 07, 2009 1:23 am    Post subject: output of the query intp dataset not SYSPRINT
Reply with quote

Hi,

After reading Running SQL query using JCL I want the output of the query in the dataset instead of the SYSPRINT,
Please tell the steps to do the same.

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

Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Thu May 07, 2009 1:39 am    Post subject: I wrote ....
Reply with quote

Code:
//STEP1   EXEC DSNTEP2,DB2=SYSE                   
//SYSTSPRT DD  SYSOUT=*                           
//SYSPRINT DD  SYSOUT=*                           
//SYSUT2   DD  DSN=PRGSD1.DRADR.DRNBR,             
//         DISP=(NEW,CATLG,DELETE),               
//         DCB=(RECFM=FB,LRECL=05,BLKSIZE=5000),   
//         UNIT=PRDDA,                             
//         SPACE=(CYL,(500,500),RLSE)             
//SYSUDUMP DD  SYSOUT=*                           
//SYSIN    DD  DSN=PRGSD1.SPUFI.LIB(DRADR),DISP=SHR


but still it is giving the output in SYSPRINT, I want the output in the dataset PRGSD1.DRADR.DRNBR
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu May 07, 2009 1:52 am    Post subject: Re: I wrote ....
Reply with quote

I know I'm probably wrong, but whats wrong with:
Code:
//STEP1   EXEC DSNTEP2,DB2=SYSE                   
//SYSTSPRT DD  SYSOUT=*                           
//SYSPRINT DD  DSN=PRGSD1.DRADR.DRNBR,             
//         DISP=(NEW,CATLG,DELETE),               
//         DCB=(RECFM=FB,LRECL=05,BLKSIZE=5000),   
//         UNIT=PRDDA,                             
//         SPACE=(CYL,(500,500),RLSE)             
//SYSUDUMP DD  SYSOUT=*                           
//SYSIN    DD  DSN=PRGSD1.SPUFI.LIB(DRADR),DISP=SHR
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Thu May 07, 2009 2:02 am    Post subject: Tried already!!!
Reply with quote

But it is giving me the error:

IBM0208S ONCODE=87 The UNDEFINEDFILE condition was raised because the wrong BLOCKSIZE or record length was specified ('ONFILE'= SYSPRINT).

From compile unit DSNTEP2 at entry point READRTN at compile unit offset +000034D4 at entry offset +00000490 at address 16C4ED0C.


The output field is having the format as DECIMAL (9,0) means PIC X(9) COMP-3......that's why I used record length as 5.....I tried with record length = 9 also, but it is giving me the same error.

Thanks,
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Thu May 07, 2009 2:09 am    Post subject:
Reply with quote

SYSPRINT would be for printed output try

Code:
DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0),   


"DECIMAL (9,0) means PIC X(9) COMP-3." No it means pic s9(9) comp-3.
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Thu May 07, 2009 2:20 am    Post subject: It's working Man!!!!
Reply with quote

icon_biggrin.gif Thanks a lot, Craq!!!
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu May 07, 2009 2:25 am    Post subject:
Reply with quote

DSNTEP2 and DSNTEP4 data sets:
Data Set Description
SYSIN
Input data set. In this data set, you can enter any number of SQL statements, each terminated with a semicolon. A statement can span multiple lines, but DSNTEP2 or DSNTEP4 reads only the first 72 bytes of each line.
SYSPRINT
Output data set. DSNTEP2 and DSNTEP4 write informational and error messages in this data set. DSNTEP2 and DSNTEP4 write output records of no more than 133 bytes.
Define all data sets as sequential data sets.

I guess you'll need a simple utility to reformat the lrecl.....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 07, 2009 5:37 pm    Post subject:
Reply with quote

Quote:
DECIMAL (9,0) means PIC X(9) COMP-3
Huh? How can a PIC cluase of type "alphanumeric (X(9))" be of usage "comp-3" . . . icon_confused.gif
Back to top
View user's profile Send private message
Sagar_mainframe

New User


Joined: 07 Jun 2008
Posts: 34
Location: Harrisburg, Pennsylvania

PostPosted: Thu May 07, 2009 6:14 pm    Post subject: Mistake
Reply with quote

yah...That was huge mistake made in hurry icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 07, 2009 7:03 pm    Post subject: Re: Tried already!!!
Reply with quote

Sagar_mainframe wrote:
IBM0208S ONCODE=87 The UNDEFINEDFILE condition was raised because the wrong BLOCKSIZE or record length was specified ('ONFILE'= SYSPRINT).
This is what IBM says:Defining the output data set (SYSPRINT) . . .

Specify the following items for the data set that you define:

The name of a sequential data set, the name of a PDS or PDSE member, or an HFS path.
A data set LRECL of 133.
A data set RECFM of F or B.
A block size, using the BLKSIZE subparameter of the DCB parameter. Otherwise, let the system set a system-determined default block size.
So you need LRECL of 133 as suggested earlier.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu May 07, 2009 7:14 pm    Post subject: Re: Mistake
Reply with quote

Sagar_mainframe wrote:
yah...That was huge mistake made in hurry icon_smile.gif
Not to worry, once in a while everyone does that . . . icon_smile.gif
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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts JES2 doesn't honor the priority of th... Aron Lendvai JCL & VSAM 7 Thu Jun 29, 2017 1:41 pm


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