Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

convert spreadsheet value to packed decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Sep 11, 2014 6:22 pm    Post subject: convert spreadsheet value to packed decimal
Reply with quote

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
View user's profile Send private message

prino

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Thu Sep 11, 2014 6:55 pm    Post subject:
Reply with quote

C and F are both positive signs, so who cares?
Back to top
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Sep 11, 2014 7:39 pm    Post subject: Reply to: convert spreadsheet value to packed decimal
Reply with quote

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
Code:
    dð
0000884
00064C0

Thanks
Back to top
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Sep 11, 2014 7:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Sep 11, 2014 7:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Fri Sep 12, 2014 11:09 am    Post subject: Reply to: convert spreadsheet value to packed decimal
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Fri Sep 12, 2014 9:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Sat Sep 13, 2014 3:11 pm    Post subject: Reply to: convert spreadsheet value to packed decimal
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Sun Sep 14, 2014 10:44 am    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Mon Sep 15, 2014 8:15 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Sep 15, 2014 10:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Mon Sep 15, 2014 11:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Gabriel Araujo Alves

New User


Joined: 20 Jul 2010
Posts: 38
Location: Brazil

PostPosted: Tue Sep 16, 2014 7:29 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Thu Sep 18, 2014 5:30 am    Post subject: Reply to: convert spreadsheet value to packed decimal
Reply with quote

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
View user's profile Send private message
faizm

New User


Joined: 13 Apr 2012
Posts: 59
Location: India

PostPosted: Thu Sep 18, 2014 6:43 pm    Post subject:
Reply with quote

Hey Bill,
I used PDC and it works icon_smile.gif
Thank you all for giving your valuable inputs.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Convert +9999999999999.99 to S9(12)V9(3) vnktrrd DFSORT/ICETOOL 8 Thu Nov 17, 2016 8:15 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts convert PD to ZD ram_vizag DFSORT/ICETOOL 5 Sat Nov 05, 2016 3:06 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us