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
 

 

SyncSort conversion for comparison

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: SyncSort conversion for comparison
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Sep 29, 2012 1:23 pm    Post subject: Reply to: SyncSort conversion for comparison
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    Post subject: Reply to: SyncSort conversion for comparison
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat Sep 29, 2012 3:52 pm    Post subject: Reply to: SyncSort conversion for comparison
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    Post subject: Reply to: SyncSort conversion for comparison
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    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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am


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