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

SORT packed decimal field which is S9(6) PACKED DECIMAL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Anithals

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 04, 2007 10:55 pm
Reply with quote

We need the following:

Input file has a packed decimal field which is S9(6) PACKED DECIMAL.

The output also should have the same declaration.

Input file has 4 bytes length and the output file should have 2 bytes.

For eg : Input has a record value 31000
the output file should have value 031.

Both of them should be packed decimal / COMP-3 only.

Can anyone help in this regard.

Thanks in advance.

Regards,
Anitha
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: Mon Jun 04, 2007 11:33 pm
Reply with quote

Are you saying you have a 4-byte PD field with 6 digits and you want to divide it by 1000 to get a 2-byte PD field with 3 digits?

You say input and output should have the same declaration, but then you say the input has 4 bytes, and the output should have 2 bytes ... that seems like a contradiction. If the output is only 2 bytes, it can't have S9(6) PACKED DECIMAL as its declaration since that takes 4 bytes. It could have S9(3) PACKED DECIMAL.

Please clarify what you want.
Back to top
View user's profile Send private message
Anithals

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Mon Jun 04, 2007 11:48 pm
Reply with quote

Hi,

I will rephrase the question.

The input and output should have the declaration S9(6) packed decimal.
But the value should change.
For eg: 31000 to 031

Please suggest.

Regs,
Anitha
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: Tue Jun 05, 2007 12:42 am
Reply with quote

You can use these DFSORT control statements:

Code:

   OPTION COPY
   INREC OVERLAY=(1:1,4,PD,DIV,+1000,TO=PD,LENGTH=4)


If your input record has X'0031000C', your output record will have X'0000031C'.
Back to top
View user's profile Send private message
Anithals

New User


Joined: 23 Jun 2006
Posts: 5

PostPosted: Tue Jun 05, 2007 7:08 pm
Reply with quote

Hi,

Thanks. Its working now.

Regs,
Anitha
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top