View previous topic :: View next topic
|
Author |
Message |
sandy mahajan
New User
Joined: 31 Aug 2011 Posts: 4 Location: India
|
|
|
|
My requirement is that, my job would download the DB2 table into flat file and in next setp, I need to format that download file.
At column 1 have row count with define as interger (as db2 format). I need to format this to read able format.
When I am chekcing down load file it showing ROW COUNT in non readable format like pack value.
if db2 row count is 34567 then by out put would be 000034567 since in flat file I have allocated 9 bytes for this row count.
In out put file position start from 1-9 in download file the position for integer start from 1-4.
Please provide the solution. |
|
Back to top |
|
|
sandy mahajan
New User
Joined: 31 Aug 2011 Posts: 4 Location: India
|
|
|
|
I have tried
SORT COPY,
OUTREC FIELED=(1:01,4,TO=FS,LENGTH=09,M0)
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
66751 .....................................................................
66752 .....................................................................
66753 .....................................................................
******************************** Bottom of Data |
It is taking byte and in addition to that I required
like following out put.
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
000066751 .....................................................................
000066752 .....................................................................
000126753 .....................................................................
******************************** Bottom of Data |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
topic edited to add the <code> tags,
learn how to use them in order to improve the readability of Your questions ! |
|
Back to top |
|
|
sandy mahajan
New User
Joined: 31 Aug 2011 Posts: 4 Location: India
|
|
|
|
Thanks Enrico, I am very new to this forum, this is my very first post, I have put it. |
|
Back to top |
|
|
sandy mahajan
New User
Joined: 31 Aug 2011 Posts: 4 Location: India
|
|
|
|
Got it. I am able to fix this. This is very new for new, I rarely used DFSORT,
Code: |
SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:01,4,BI,EDIT=(TTTTTTTTT) |
It has given me following out put.
Code: |
********************************* Top of Data ***********
000000001................................................
000000002................................................
000000003................................................
000000004................................................
000000005................................................
000000006................................................
000000007................................................
000000008................................................
000000009................................................
000000010................................................
000000011................................................
000000012................................................
000000013................................................
000000014................................................
000000015................................................
000000016................................................
000000017................................................
000000018................................................
000000019................................................
000000020................................................
000000021................................................
000000022................................................
000000023................................................
000000024................................................
000000025................................................
000000026................................................
000000027................................................
000000028................................................ |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you know that you can CAST with your SQL in your download process,
negating the need for the DFSORT steps.
But, congratulations on your success with the sort control cards. |
|
Back to top |
|
|
|