Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to convert pack decimal to read able format with dfsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to convert pack decimal to read able format with dfsort
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Wed Aug 31, 2011 1:08 pm    Post subject: Reply to: Need to convert pack decimal to read able format w
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    Post subject:
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    Post subject:
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: 6968
Location: porcelain throne

PostPosted: Wed Aug 31, 2011 2:30 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Fetch Previous month & year in MM... girishb2 DFSORT/ICETOOL 3 Thu Sep 21, 2017 9:54 pm
No new posts how to see when the last read access ... Mike 1304 DB2 1 Tue Sep 12, 2017 7:52 pm
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us