View previous topic :: View next topic
|
Author |
Message |
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
Hi,
I unloaded the table with a unload jcl using utility IKJEFT01. The integer values in the table were unloaded as some junk values. Is there any utility to unload the integer values from the table as such??
Thanks, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Define junk values |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Generate the DCLGEN for the table and then compare it with unloaded dataset.
By that I think you will get your answer. |
|
Back to top |
|
|
Steve Davies
New User
Joined: 15 Oct 2009 Posts: 32 Location: UK
|
|
|
|
By saying you are using IKJEFT01 to unload a table, do you really mean you are using the DSNTIAUL unload utility?
Perhaps post your JCL. Do you know how to look at the integer fields in HEX in your output file? Are you expecting them to be in display format? |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
I am using DSNTIAUL unload utility. I want the attributes defined in the table as integer to be unloaded in readable format.
It was unloaded as
±^
°
þ5
þÕ
þ0
þ6
þ6
±ê
þ5
þ5
þ6
±ê
þÔ
þ5
Thanks, |
|
Back to top |
|
|
Steve Davies
New User
Joined: 15 Oct 2009 Posts: 32 Location: UK
|
|
|
|
You have an SQL statement as input then, like
//SYSIN DD *
SELECT * FROM TABLE.NAME ;
I think (I may be wrong as I'm doing this from memory) you'll have to select each column by name and for the integer columns say
CHAR(integer_column_name),
apologies if I'm wrong.... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
janani vs,
show the control cards that you are using.
second request. |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
If I use CHAR(integer_column_name) and select every column in the table individually, then the jcl becomes static i cannot use that jcl to unload some other tables.
Thanks, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello Janani,
You need to anyways changed the jcl as per Table. Its better to put control card in dataset instead of instream. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Quote: |
then the jcl becomes static i cannot use that jcl to unload some other tables. |
if the table name changes something must be changed in Jour jcl, do You agree ?
and You must make a decision,
keep the control statements simple, easily modified for a different table..
or have the data unloaded in a more understandable format ...
the choice is only Yours, no reason to complain afterwards |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
hi,
this is the jcl am using,
//UNLOAD2 JOB 'UNLOAD','UNLOAD',CLASS=2,MSGCLASS=X,
// MSGLEVEL=(1,1),NOTIFY=&SYSUID
//STEP1 EXEC PGM=IKJEFT1B,DYNAMNBR=20,TIME=120,REGION=3072K
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//REPORT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(db2 subsystem)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) LIB('db2 subsystem.RUNLIB.LOAD') -
PARMS('SQL')
//SYSPRINT DD SYSOUT=*
//SYSPUNCH DD DUMMY
//SYSREC00 DD DSN=dataset name,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(200,200),RLSE),
// UNIT=SYSDA
//SYSIN DD *
SELECT * FROM tablename;
/*
Thanks, |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
hi,
this condition CHAR(integer_column_name)
works.But what if one is unaware of the column names and there definition(ie whether it is a integer or not) of the table.
thanks, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Janani,
Then one check the table structure either using Admin Tool or Sysibm table or dclgen's . |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
Hi Ekta,
yeah in DCLGEN, i can know about the column names and definitions. But what if one does not about anything and just knows the table name.
thanks, |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Then One can check in DCLGEN , or in any Admin tool or cataloge tables |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
janani vs wrote: |
But what if one does not about anything and just knows the table name. |
Then s/he must not touch that table...grin |
|
Back to top |
|
|
Steve Davies
New User
Joined: 15 Oct 2009 Posts: 32 Location: UK
|
|
|
|
JANANI V S
Well, if this is not a good solution for you then you'd better start learning how to look at binary fields in your unload dataset. Here's a start....... 'SET HEX ON'
It doesn't sound like a difficult problem. You just need to decide what you want to do. How can you not know the column names of a table? There are many places to look to find those out. |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
I think he means : What if the control card should be generated for any given table.
Generating "select * from table" is a lot easier than generating a select with all columns (with or without char() ).
Maybe you shouldn't try to use dsntiaul , but look at the possibilities of UNLOAD DELIMITED |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Where is the unloaded data to be used?
If by some other mainframe process, there is no need for the data to be readable by human eyes. . . The data as unloaded is perfectly usable. |
|
Back to top |
|
|
Steve Davies
New User
Joined: 15 Oct 2009 Posts: 32 Location: UK
|
|
|
|
GuyC wrote: |
I think he means : What if the control card should be generated for any given table.
Generating "select * from table" is a lot easier than generating a select with all columns (with or without char() ).
Maybe you shouldn't try to use dsntiaul , but look at the possibilities of UNLOAD DELIMITED |
Perhaps 'janaini vs' could confirm this. To me it sounds like this person has one unload JCL member that is edited each time a table requires to be unloaded. So it is easy to change the table name before submitting the job. Adding all the column names would require some effort.
The purpose of why the table is unloaded would be good to know. If it is to be read by another mainframe process, why do the integer fields need to be in a displayable format? (as mentioned in the post above)
Perhaps 'janaini vs' could say why the integer fields are needed in displayable format, this will help us all give a valid solution. |
|
Back to top |
|
|
janani vs
New User
Joined: 01 Sep 2009 Posts: 15 Location: CHENNAI
|
|
|
|
Hi everybody,
Thanks for your response.
Actually I need the integer fields to be displyed in a readable format.
Thanks, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
Actually I need the integer fields to be displyed in a readable format |
talk about pulling teeth |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Actually I need the integer fields to be displyed in a readable format. |
Quote: |
talk about pulling teeth |
Why? Suggest you use the process as it exists or write a more suitable custom process (and yup, that will surely take some effort). |
|
Back to top |
|
|
|