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

How to hard code the PD(Packed Decimal) data thru SYNCSORT


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Wed Jan 30, 2008 9:13 pm
Reply with quote

I have to hard code +99999999999999.99 to a field in packed decimal format.

Can you please let me know how to do this.

I have tried the below method , but it works if the value is without decimal.

SORT FIELDS=(1,10,CH,A)
INREC FIELDS=(1,10,+999999999999999,PD,LENGTH=8)
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jan 30, 2008 9:34 pm
Reply with quote

PD fields do not have a decimal point. The program reading or writing the field must know where the point is.
For example, if a packed field contains X'0123456F', it will be interpreted by a program as:
123.456 if the program defines the field as PIC 9(4)V9(3) COMP-3
1234.56 if the program defines the field as PIC 9(5)V9(2) COMP-3
0.123456 if the program defines the field as PIC 9V9(6) COMP-3
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Thu Jan 31, 2008 10:55 am
Reply with quote

Brit,

i encountered a similar situation in recent time. I need to insert 4.1 into the attribute defined as PD.

I used the following sort card for that.

Code:
//SYSIN    DD  *                             
   SORT FIELDS=COPY                         
   OUTREC FIELDS=(1,11,X'00410C',12,68)     
/*     


Hope the explanation given by marso is sufficient.

Marso,

Pretty neat explanation buddy.
Back to top
View user's profile Send private message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Thu Jan 31, 2008 2:03 pm
Reply with quote

I have tried with the Hex value. It is working fine.
Thanks a lot
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top