Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 10276
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 Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 5 Wed Jul 26, 2017 7:35 pm
No new posts Convert CLIST to REXX cvnlynn CLIST & REXX 12 Tue Jun 27, 2017 2:06 am
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us