View previous topic :: View next topic
|
Author |
Message |
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Hi,
I am trying to convert the decimal value in excel sheet to S9(9)V9(2) comp-3 by using JCL SORT and below SYSIN
i/p file is LRECL 42, FB
o/p file is LRECL,38,FB
when I transferred this excel to PS file, I can see the values are represented as below
Code: |
----+----1----+----2----+----3----+----4--
ABC JOHNXXXXXXXXX20140911ZB 68.48
CCC44DDCDEEEEEEEEEFFFFFFFFEC444FF4FF444444
123001685777777777201409119200068B48000000
|
I am using below sysin
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,31,32,6,ZD,TO=PD,LENGTH=6)
/* |
output coming as
Code: |
ABC JOHNXXXXXXXXX20140911ZB d±
CCC44DDCDEEEEEEEEEFFFFFFFFEC4440000884
123001685777777777201409119200000064F0 |
My question: Instead of C in hex value against the value 68.48, why it is coming as 'F' in output record and I think it should be 'C'. Please help what changes in SORT CARD is required to get 'C' in place of 'F'.
Thanks |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1316 Location: Vilnius, Lithuania
|
|
|
|
C and F are both positive signs, so who cares? |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
yeah thats correct but when I am trying to match this file with another file that has same record, it doesn't match. HEX value displayed in the second file is shown as
Thanks |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Apologize, I posted the wrong SYSIN in my first post. I am using the below SYSIN card
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,31,32,11,UFF,ZD,LENGTH=11)
/* |
Thanks |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
actually got confused, my first post sysin is what I am using i.e
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,31,32,11,UFF,PD,LENGTH=6,38,1)
/* |
Thanks |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Please help how we can accomplish getting 'C' in place of 'F'. My second file has the amount field defined as S9(9)V9(2) COMP-3. If we can do this through SORT where we can convert the excel value to the signed COMP-3 value? Thanks |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Try below,
Code: |
//STEP01 EXEC PGM=SORT
//*-----------------------------------------------
//SYSOUT DD SYSOUT=*
//SORTIN DD *
68.48
//SORTOUT DD DSN= you.dsn
//SYSIN DD *
SORT FIELDS=COPY
INREC OVERLAY=(6:1,5,UFF,TO=PD,LENGTH=5) |
Output:
Code: |
----+----1-
***********
68.48 dð
FF4FF000884
68B480064C0 |
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Faizm,
Would you mind posting the sysout from the step which gives you that result?
Rohit,
There is no substantial difference from what you have posted and what TS/OP has for their control cards. Did you try the original control cards? What did you get? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Off hand and if I'm not missing the obvious - from the SORT card you later posted, if you change ZD to ZDC - you should get a 'C' sign for positive values? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Bill, I might be doing something wrong for sure, as when I executed his control cards the conversion did not happen and job ran successful.
However, would Inrec Overlay and Outrec Build makes a deffierence to the results? I would double check my card later today.
Anuj, I think, ZDC/ZDF is used to get Zoned Decimals as a output after the conversion and not Vice Versa. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
I do not follow you Rohit. My intention is to tell that if OP wants to get 'C' instead of 'F' for positive values - PDC(F) or ZDC(F) should do the trick, assuming everything else is just correct. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Code: |
TO=ZDF, TO=ZDC, TO=PDF, TO=PDC
TO=ZDF and TO=ZDC are new output formats you can use in the INREC, OUTREC and OUTFIL statements wherever TO=ZD can be used (converted fields, statistics, page numbers, counts, and so on). With TO=ZDF or TO=ZD, DFSORT uses an F sign for each positive ZD value (for example, +12 = X’F1F2’). With TO=ZDC, DFSORT uses a C sign for each positive ZD value (for example, +12 = X’F1C2’). In either case, DFSORT uses a D sign for each negative ZD value (for example, -12 = X’F1D2’). |
TS/OP wants to convert (ZD/ZDF/ZDC/PDF/PDC) TO PD. But your's is true if our target/result format wants to be any of these(ZD/ZDF/ZDC/PDF/PDC).
Hope, I am understanding these sequence correctly. |
|
Back to top |
|
|
Gabriel Araujo Alves
New User
Joined: 20 Jul 2010 Posts: 38 Location: Brazil
|
|
|
|
faizm,
I usually do it this way.
Code: |
//SORT01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
68.48
-68.48
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=((1,6,SFF,MUL,+1),TO=PD,LENGTH=5)
|
and the sysout
Code: |
00088
0064C
_____
dý
00088
0064D
|
Regards. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I think our shy TS/OP actually has SyncSort. DFSORT will give the C for a positive in a PD. PDC in DFSORT will give an identical result. PDF gives the F for positive.
I think SyncSORT does it differently. PD gives the F and PDC the C for a positive.
TS/OP has got their answer and is long gone. |
|
Back to top |
|
|
faizm
New User
Joined: 13 Apr 2012 Posts: 59 Location: India
|
|
|
|
Hey Bill,
I used PDC and it works
Thank you all for giving your valuable inputs. |
|
Back to top |
|
|
|