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

output of the query intp dataset not SYSPRINT


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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: 2146
Location: At my coffee table

PostPosted: Thu May 07, 2009 1:52 am
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
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
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
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: 2146
Location: At my coffee table

PostPosted: Thu May 07, 2009 2:25 am
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

Superior Member


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

PostPosted: Thu May 07, 2009 5:37 pm
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
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

Superior Member


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

PostPosted: Thu May 07, 2009 7:03 pm
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

Superior Member


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

PostPosted: Thu May 07, 2009 7:14 pm
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 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 RC query -Time column CA Products 3
Search our Forums:

Back to Top