Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT packed decimal field which is S9(6) PACKED DECIMAL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT packed decimal field which is S9(6) PACKED DECIMAL
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 Moderator


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

PostPosted: Mon Jun 04, 2007 11:33 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Jun 05, 2007 12:42 am    Post subject:
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    Post subject:
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    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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us