View previous topic :: View next topic
|
Author |
Message |
itdsen
New User
Joined: 20 Sep 2006 Posts: 23 Location: Chennai
|
|
|
|
Hi,
Input file contains 1st 6 byte as numeric, I want to read it and convert into packed decimal (comp-3).
I tried to convert in sort by using below code. I worked fine but expected values in sign byte 'C' but i am getting 'F in hex values.’
Can someone guide me on this?
Code:OPTION COPY
OUTREC OVERLAY=(1,6,FS,TO=PD,LENGTH=4)
Input file:
100111abc...
Output file (hex format)
1011
011F
Excepted is
1011
011C |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have a look in the manual to confirm, then try TO=PDC |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
D.Senthil kumar.
DFSORT would give you a C sign with TO=PD, so if you're getting an F sign, I can only conclude that you're using Syncsort (WER messages), not DFSORT (ICE messages).
This is the DFSORT Forum for DFSORT questions. Please use the JCL Forum for Syncsort questions. |
|
Back to top |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
Hi,
Please try the below code:
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
452921
351052
260114
623460
812325
352328
//SORTOUT DD DSN=XXXX.TEST.PDVALUES,DISP=(,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,5,UFF,TO=PD) |
Copybook Layout:
Code: |
****** ***************************** Top of Data ************
000001 01 OUTREC.
000002 05 FIELD1 PIC 9(4)V99 COMP-3.
****** **************************** Bottom of Data ********** |
u will get the excepted output.Next time onwards,Please post in the correct section. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sorry if this sort-rookie poses a question,
but
if the input is 6 char
Code: |
//SORTIN DD *
452921 |
how does this work?
Code: |
OUTREC FIELDS=(1,5,UFF,TO=PD) |
why would it not be
Code: |
OUTREC FIELDS=(1,6,UFF,TO=PD) |
or does syncsort have its own method of doing things? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Syncsort is similar to DFSORT in many (most) control statements - though there are some cases where the "same" functionality has somewhat different syntax.
Yup, i believe the 1,6 is correct (rather than the 1,5). |
|
Back to top |
|
|
|