|
View previous topic :: View next topic
|
| Author |
Message |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
Iam getting a problem in allocating a dataset. The record length of the dataset should be 500.
| Code: |
//***************************************************
//DELFIL EXEC PGM=IEFBR14
//CASE DD DSN=HXSULL.QUERY,
// DISP=(MOD,DELETE,DELETE),
// UNIT=TEST,
// SPACE=(TRK,0)
//***************************************************
//CREATF EXEC PGM=BZALLOC
//CASE DD DSN=HXSULL.QUERY,
// DISP=(NEW,KEEP,KEEP),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=15000),
// SPACE=(TRK,(1,1))
//*************************************************** |
|
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
| Quote: |
| Iam getting a problem in allocating a dataset. |
What problem? You need to post the error message including any message id.
What is bzalloc? You specified (new,keep,keep) which is invalid in many systems. The rules of jcl would permit it, but it violates standards many places.
When you post the error(s) someone should be able to help. |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| As asked by Dick, what is the problem, psycic abilities only work on Wednesday. |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
The is the JCL program, which will be getting records from the table and write it to a dataset. This jcl program works just fine.
| Code: |
//HXSULLXX JOB (T,TEST),'HXSULL',MSGCLASS=X,CLASS=L,NOTIFY=&SYSUID,
// REGION=0M
//DSNTEP2 EXEC PGM=IKJEFT01,COND=(4,LT),DYNAMNBR=20
//SYSTSIN DD *
DSN SYSTEM(DB2D)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('DB2.POPR.PROD.RUNLIB.LOAD')
END
//SYSTSPRT DD SYSOUT=*
//SYSOUT DD *
//SYSPRINT DD DSN=HXSULL.QUERY,
// DISP=(NEW,KEEP,KEEP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=2400),
// UNIT=SYSDA,SPACE=(TRK,(1,1))
//SYSIN DD *
SELECT * FROM INEDATAT.INET_LSW_CONTRACT
FETCH FIRST 100 ROWS ONLY;
END
//GENER EXEC PGM=IEBGENER
//SYSUT1 DD DSN=HXSULL.QUERY,DISP=SHR
//SYSUT2 DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//********************************************************************* |
But, the thing is the table has lots of columns. So, maximum length has to be 500 for each line in the dataset(hxsull.query). And each time i have to delete the dataset to run this job. So, i made few modifications to the earlier program.
First part = House-Cleaning - Deleting & Creating the dataset.
Second part = DSNTEP2 which works properly writes to the dataset.
Third part = The records also has to be in the SPOOL(SYSUT2).
| Code: |
//HXSULLXX JOB (T,TEST),'JCL QUERY',MSGCLASS=X,CLASS=L,REGION=0M,
// NOTIFY=&SYSUID
//*********************************************************************
//* JCL TO RUN QUERY *
//*********************************************************************
//DELETEF EXEC PGM=IEFBR14
//CASE DD DSN=HXSULL.QUERY,
// DISP=(MOD,DELETE,DELETE),
// UNIT=TEST,
// SPACE=(TRK,0)
//*
//CREATF EXEC PGM=BZALLOC
//CASE DD DSN=HXSULL.QUERY,
// DISP=(NEW,KEEP,KEEP),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=500,BLKSIZE=7500),
// SPACE=(TRK,(1,1))
//*********************************************************************
//DSNTEP2 EXEC PGM=IKJEFT01,COND=(4,LT),DYNAMNBR=20
//SYSTSIN DD *
DSN SYSTEM(DB2D)
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) -
LIB('DB2.POPR.PROD.RUNLIB.LOAD')
END
//SYSTSPRT DD SYSOUT=*
//SYSOUT DD *
//SYSPRINT DD DSN=HXSULL.QUERY,DISP=OLD
//SYSIN DD *
SELECT * FROM INEDATAT.INET_CASE
FETCH FIRST 100 ROWS ONLY;
END
//*********************************************************************
//GENER EXEC PGM=IEBGENER
//SYSUT1 DD DSN=HXSULL.QUERY,DISP=SHR
//SYSUT2 DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=500)
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//********************************************************************* |
I must be making mistakes in the allocation of dataset(HXSULL.QUERY).
IEFBR14 - We use to DELETE Datasets
BZALLOC - Creation of datasets
ERRORS In spool -
SYSTSPRT
| Code: |
READY
DSN SYSTEM(DB2D)
DSN
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) LIB('DB2.POPR.PROD.RUNLIB.LOAD')
DSN ENDED DUE TO ERROR+
SYSTEM ABEND CODE 001 REASON CODE 00000000 |
SYSPRINT
| Code: |
DATA SET UTILITY - GENERATE
IEB311I CONFLICTING DCB PARAMETERS |
|
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try not specifying the LRECL on the SYSUT2 statement.
Gerry |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
or check what the LRECL of the file is after it has been written to,
it's possible it's been overwritten by the program.
Gerry |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
| Code: |
DELETEF - STEP WAS EXECUTED - COND CODE 0000
HXSULLXX CREATF - STEP WAS EXECUTED - COND CODE 0000
HXSULL.QUERY RETAINED, DDNAME=CASE
STEP/CREATF /START 2008267.0244
STEP/CREATF /STOP 2008267.0244 CPU 0MIN 00.01SEC SRB 0MIN 00.00
ALLOC. FOR HXSULLXX DSNTEP2
JES2 ALLOCATED TO SYSTSIN
JES2 ALLOCATED TO SYSTSPRT
JES2 ALLOCATED TO SYSOUT
SMS ALLOCATED TO DDNAME SYSPRINT
JES2 ALLOCATED TO SYSIN
B709 ALLOCATED TO SYS00001
SYS1.UADS KEPT
VOL SER NOS= CATA10.
SMS ALLOCATED TO DDNAME SYS00002
001-4,HXSULLXX,DSNTEP2 ,SYSOUT ,JES
EROPT IS 'ABE' OR NOT SPECIFIED
SMS ALLOCATED TO DDNAME (SYS00004)
DSN (SYS08267.T024441.RA000.HXSULLXX.T3298736.H01)
STORCLAS (SC02) MGMTCLAS ( ) DATACLAS ( )
.
.lots of dump is here.
.
.
DSNTEP2 - STEP WAS EXECUTED - COND CODE 0012
GENER - STEP WAS EXECUTED - COND CODE 0000 |
In DSNTEP2 lot of dump is there.
SYSPRINT
| Code: |
DATA SET UTILITY - GENERATE
IEB352I WARNING: ONE OR MORE OF THE OUTPUT DCB PARMS COPIED FROM INPUT |
PROCESSING ENDED AT EOD
SYSTSPRT
R
| Code: |
EADY
DSN SYSTEM(DB2D)
DSN
RUN PROGRAM(DSNTEP2) PLAN(DSNTEP2) LIB('DB2.POPR.PROD.RUNLIB.LOAD')
DSN ENDED DUE TO ERROR+
SYSTEM ABEND CODE 001 REASON CODE 00000000 |
Is dump because of in DISP=(NEW,KEEP,KEEP)
a lot of allocations are being made. it is said as "KEPT" |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I think that you may find there is a limitation on the output length of data that is written to the spool, SYSOUT=
It also appears that there is a problem in the query to start with.
| Quote: |
| DSN ENDED DUE TO ERROR+ |
First suggestion is to allocate the dataset HXSULL.QUERY in the query itself but do not specify any DCB info.
So my priority would be to resolve the errors in which they occur rather than start from the end and work backwards. Once the query is working you can then play with the printing part. |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
You have specified sysout as a dd * - which by definition is input. . . |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
| Quote: |
| So my priority would be to resolve the errors in which they occur rather than start from the end and work backwards. Once the query is working you can then play with the printing part. |
I removed the last IEBGENER and DCB in creating DS. And i executed the job.
ABEND S013 is coming..... |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I can vaguely recall this same problem a few months back, unfortunately at a previous shop, but can not for the life of me recall the solution.
It some how rings a bell that we used VB 2004 as the output from the query - so my original idea of dropping the DCB may well have been wrong .
It may even have been VBA - but try both. |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
Can you tell me the JCL which you use to create lengthy datasets |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
| sushanth bobby wrote: |
Hi,
Can you tell me the JCL which you use to create lengthy datasets |
Huh ??? The same as creating any dataset of course.
| Code: |
//SYSPRINT DD DSN=HXSULL.QUERY,DISP=(,CATLG,KEEP),
// RECFM=VBA,LRECL=2004,
// SPACE=(CYL,(50,50),RLSE)
|
|
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
I have come to a conclusion that datasets(JESMSGLG,JESJCL,JESYSMSG,SYSTSPRT,SYSUT2,SYSPRINT) in the spool have the same properties or attributes(
i.e.,space units=BLKS, priqty=500, secqty=500, record format=VBA,Record Length=240, block size=3120), so spool datasets have some limitations.
All i wanted is to have a result dataset looking like,
Col1 col2 Col3 col4 Col5 col6 Col7 col8 Col9 col10
.
.
.
.
.
.
.
.
in this order
But now the result is like
Page 1
Col1 col2 col3 col4 col5
.
.
.
.
.
.
..
.
.
Page 2
Col 6 col7 col8 col9 col10
.
.
.
.
.
Do you guyz understand what iam trying to say here.
I want to create a dataset capable of holding a particular column length.
Is it possible ? |
|
| Back to top |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Yes, I think that you are correct in what you say about the spooling limitations of the job that you are running.
I have had a quick search through my notes and have found that the solution at the previous site was to execute the SQL code using REXX and then write the required data out to a dataset using REXX, in the correct format.
I may (or may not) have some REXX code to do this, and will post it if I can find it.
It may even be worth putting a post in the DB2 forum explaining that your output is OK, but not in the format that you want as the columns are spread over multiple pages and ask if there is a way that the output can be routed to a dataset without having to use the SYSPRINT DD name. |
|
| Back to top |
|
 |
sushanth bobby
Senior Member

Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thank You EXPAT & Thank You ALL,
For giving me a possible solution. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|