View previous topic :: View next topic
|
Author |
Message |
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
Could you please help me to reformat the following using SORT
Input file of record length 22 bytes
Code: |
01 WS-REC.
01 WS-ACCOUNT PIC X(05).
01 WS-AMOUNT PIC 9(9).9(6)
01 WS-IND PIC X(1)
AA100 10.123456R
|
Can you please help me to reformat the above record to as below using SORT card.
Code: |
01 WS-REC.
01 WS-ACCOUNT PIC X(05).
01 WS-AMOUNT PIC 9(9)V9(6) COMP-3
01 WS-IND PIC X(1) |
This output record length will be 14 bytes.
Thanks
Vinu |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
This has been discussed may a times on this forum, so please try searching and also do try for UFF to PD. |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi Rohit,
Thanks for the suggestion. I have tried using below SORT card, however not getting desired result
Code: |
OPTION COPY
OUTREC FIELDS=(1:1,5,6:6,15,UFF,TO=PD,14:22,1) |
I got the output as
Code: |
WS-ACCOUNT WS-DATE-CYCLE WS-IND
AA100 1.012345 R
|
However I was expecting the output as 10.123456
Then I updated the SOrt card as
OPTION COPY
OUTREC FIELDS=(1:1,5,6:6,16,UFF,TO=PD,14:22,1)
But job abended with U0016.
Can you please help me.
Thanks
Vinu |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
How about posting the messages? |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi Nic,
Actually I got these records with amount in an excel sheet and my requirement is to put it in a Mainframe dataset with amount field as S9(9)V9(6) COMP-3
Thanks
Chidam |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
Could you please help me to accomplish this using SORT card.
Thanks
Vinu |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1222 Location: Bamberg, Germany
|
|
|
|
Have you tried?
Code: |
OUTREC BUILD=(1,5,6,16,UFF,TO=PD,LENGTH=8,22,1) |
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
vinu78 wrote: |
Hi Nic,
Actually I got these records with amount in an excel sheet and my requirement is to put it in a Mainframe dataset with amount field as S9(9)V9(6) COMP-3
Thanks
Chidam |
What has that to do with posting the DFSort messages that detail your error? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
Joerg.Findeisen wrote: |
Have you tried?
Code: |
OUTREC BUILD=(1,5,
6,16,UFF,TO=PD,LENGTH=8,
22,1) |
|
I guess, it would make sense to give explanation to TS: his target output field PIC 9(9)V9(6) COMP-3 has length 8 bytes (I hope he knows why?), but the default output length after conversion TO=PD is different. That’s why explicit parameter LENGTH=8 is needed.
Without this comment, 99% of TS just copy-and-paste the given solution (some of them also respond with “Thank you!”), - without a minor understanding: why it is required? Next day the same TS, or his milk brother, will ask exactly the same question in the same forum... |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi All,
Thanks very much.
The code suggested by Jeorg worked like a charm.
Thanks everybody.
Regards
Vinu |
|
Back to top |
|
|
|