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

changing packed decimal to character


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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 Developer


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

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

sumitmalik29,

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

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
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 Developer


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

PostPosted: Sat May 30, 2009 2:31 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Help with C character vs C string All Other Mainframe Topics 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts changing defaults in db2 admin - Unlo... DB2 0
Search our Forums:

Back to Top