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

Need to convert pack decimal to read able format with dfsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sandy mahajan

New User


Joined: 31 Aug 2011
Posts: 4
Location: India

PostPosted: Wed Aug 31, 2011 12:53 pm
Reply with quote

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
View user's profile Send private message
sandy mahajan

New User


Joined: 31 Aug 2011
Posts: 4
Location: India

PostPosted: Wed Aug 31, 2011 12:58 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Aug 31, 2011 1:08 pm
Reply with quote

topic edited to add the <code> tags,
learn how to use them in order to improve the readability of Your questions !
Back to top
View user's profile Send private message
sandy mahajan

New User


Joined: 31 Aug 2011
Posts: 4
Location: India

PostPosted: Wed Aug 31, 2011 1:11 pm
Reply with quote

Thanks Enrico, I am very new to this forum, this is my very first post, I have put it.
Back to top
View user's profile Send private message
sandy mahajan

New User


Joined: 31 Aug 2011
Posts: 4
Location: India

PostPosted: Wed Aug 31, 2011 1:37 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Aug 31, 2011 2:30 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top