IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SyncSort conversion for comparison


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shaktieswararao.Hazaru

New User


Joined: 25 Sep 2010
Posts: 20
Location: Hyderabad

PostPosted: Sat Sep 29, 2012 1:11 pm
Reply with quote

Hi,

we have requirement where in the table the column is defined as integer and in the input file we get the same field as 9(6).

For file comparison we need to convert this s(9) comp to numeric.

Can anyone help us with this.

Originally attached to this topic.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Sep 29, 2012 1:23 pm
Reply with quote

shaktieswararao.Hazaru,

Please don't "tailgate" an old topic. Your question has been split. I have included a reference to the original topic.

Now to what you mean. 9(9) is "numeric" - so are you saying you want it in such a format that it can be easily-read by a human? Or what? Please take some time to clarify your question. Remember, you know what you want, and we don't, so you have to explain what needs to be done, and what you have tried.
Back to top
View user's profile Send private message
shaktieswararao.Hazaru

New User


Joined: 25 Sep 2010
Posts: 20
Location: Hyderabad

PostPosted: Sat Sep 29, 2012 1:36 pm
Reply with quote

Hi,

The actuall requiremetn is we need to unload the file from the table and to compare it with the input file we get.

In the input file the field MSG-ID = 100001 is declared as PIC 9(6), and in the table the column MSG - ID is defined as S 9(9) COMP. so when we unload the data it is in unreadabel format.

Can we compare s9(9) comp with 9(6)? If not we need to convert s 9(9) comp to integer and then we can compare the values?

I tried to convert the comp value to integer as below, but i'm not getting the exact value. the actual value in the table is 100001

Code:
//SORTOUT  DD  SYSOUT=*                             
//SYSIN DD *                                         
  SORT FIELDS=COPY                                   
  OUTREC FIELDS=(1,31,28,6,BI,EDIT=(TTTTTT),LENGTH=6)


output:
Code:
704448
704448



Please advice.

Code'd
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Sep 29, 2012 3:52 pm
Reply with quote

You've been here two years, you should be aware of the Code tags to preserve spacing of anything which requires it.

Code:
  OUTREC BUILD=(1,31,28,4,BI,EDIT=(TTTTTT),LENGTH=6)


Your COMP PIC S9(9) is four bytes long. You specified it as six. Six is solely the output length that you want. Try the above in place of yours. You should be able to correlate the six-byte value you used to the six-digit answer you got if you do the whole thing as hex-to-decimal (see your PC's calculator) with the hex value you find in those six bytes. Bear truncation in mind.

As to whether you need to convert to compare, it depends. If you are using JOINKEYS, then yes, same length and type, start-position can vary. If you are just comparing in INCLUDE/OMIT/IFTHEN, then no, you don't need to convert. If comparing manually, then yes :-)
Back to top
View user's profile Send private message
shaktieswararao.Hazaru

New User


Joined: 25 Sep 2010
Posts: 20
Location: Hyderabad

PostPosted: Sat Sep 29, 2012 5:44 pm
Reply with quote

Thank you ....
Bill Woodger
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
No new posts file manager is doing string conversion IBM Tools 3
No new posts SMF Record Date conversion failing CLIST & REXX 1
Search our Forums:

Back to Top