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
 

 

changing packed decimal to character

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Fri May 29, 2009 9:34 pm    Post subject: changing packed decimal to character
Reply with quote

Hi

i need to change the packed decimal format to character format, during a sort step
for example below record in comp-3

....äæ............á&....

needs to be changed to character format


Thanks in advance
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri May 29, 2009 10:00 pm    Post subject:
Reply with quote

sumitmalik29,

What is the position and length of the packed decimal number? How do you want the readable format? (1.234 or 1234 or 12.34 or 123.4 ? ...)

Also what is the LRECL and RECFM of input and output files?
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Sat May 30, 2009 12:51 am    Post subject: packed to character conversion?
Reply with quote

hi sukolu

the position of column is from 43 to 48 and is of length 2 bytes for packed decimal
i just want to display the result in character format,
ex:- character format would be '2008' if it is 2 byte data
just want to know the syntax

Thanks
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sat May 30, 2009 1:00 am    Post subject: Re: packed to character conversion?
Reply with quote

sumitmalik29 wrote:
hi sukolu

the position of column is from 43 to 48 and is of length 2 bytes for packed decimal
i just want to display the result in character format,
ex:- character format would be '2008' if it is 2 byte data
just want to know the syntax

Thanks


I think you should show some of the data in hex format. A 2 byte packed decimal field would be 3 digits and a sign and 43 to 48 would be 6 bytes!
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat May 30, 2009 1:02 am    Post subject:
Reply with quote

sumitmalik29,

See the following in "z/OS DFSORT: Getting Started" for the syntax:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CG30/2.4.8?DT=20080529102039
Back to top
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Sat May 30, 2009 2:17 am    Post subject:
Reply with quote

sorry,
below statement
"the position of column is from 43 to 48 and is of length 2 bytes for packed decimal"
was at typo mistake in hurry,

i used the following control statement for changing columns (in PD) from 43 to 48
OUTREC FIELDS=(43,6,PD,EDIT=('TTTTTTTTTTT'),SIGN=('+','-'))

here starting position is 43 and is of length 6 bytes for PD, on changing to character(using EDIT keyword) it expanded to 12 bytes, the last digit is reserved for sign

Thanks to all
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat May 30, 2009 2:31 am    Post subject:
Reply with quote

That EDIT mask will not give you the sign since you only have Ts (digits) in the pattern and not an S for the Sign. You have SIGN=(+,-) for the leading signs, but no S for the actual sign.

If you want a leading sign, use:

Code:

  OUTREC FIELDS=(43,6,PD,EDIT=(STTTTTTTTTTT),SIGN=(+,-))


If you want a trailing sign, use:

Code:

  OUTREC FIELDS=(43,6,PD,EDIT=(TTTTTTTTTTTS),SIGN=(,,+,-))



Note that you don't need the apostrophes, although you can use them if you like.
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 Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm
No new posts Moving character data to smallint in db2 rikdeb DB2 5 Thu Jul 14, 2016 12:38 am


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