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
 

 

Converting COMP-3 to Character using Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Wed Jun 04, 2008 6:11 pm    Post subject: Converting COMP-3 to Character using Sort
Reply with quote

Hi ,
I need to copy a COMP-3 value from input file to an output file as a character. COMP-3 value is declared as s9(9). Can you please let me know what to do.

Thanks,
Pavan.
Back to top
View user's profile Send private message

Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed Jun 04, 2008 6:51 pm    Post subject:
Reply with quote

Try this

Code:

SORT FIELDS=COPY                                   
OUTREC BUILD=(1,5,PD,EDIT=(SIIIIIIIIT),SIGNS=(,-))


Input used :

Code:

.....
22222
2222C
.....
32222
2222D


Output :

Code:

 222222222
-322222222
Back to top
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Wed Jun 04, 2008 7:18 pm    Post subject: Reply to: Converting COMP-3 to Character using Sort
Reply with quote

Thanks Manu,

I tried your sort card and come to know that some spaces will be coming in place of leading zeroes. I want to supress them.Is there any way we can change sort card and do that?
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed Jun 04, 2008 7:24 pm    Post subject:
Reply with quote

Try this

Code:

 SORT FIELDS=COPY                                   
 OUTREC BUILD=(1,5,PD,EDIT=(STTTTTTTTT),SIGNS=(+,-))
Back to top
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Wed Jun 04, 2008 7:32 pm    Post subject: Reply to: Converting COMP-3 to Character using Sort
Reply with quote

Hi Manu ,
In my input file value is x'00000123'. I need only '123' in output file. But I am getting ' 123'.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Wed Jun 04, 2008 8:51 pm    Post subject:
Reply with quote

Where is the sign bit?

You said it is declared as S9(9) Comp-3 , so it can only be x'000000123C'

in which case you will get 0123 with my code will return '+000000123'
Back to top
View user's profile Send private message
aryanpa1

New User


Joined: 26 May 2007
Posts: 45
Location: Chennai

PostPosted: Wed Jun 04, 2008 9:07 pm    Post subject: Reply to: Converting COMP-3 to Character using Sort
Reply with quote

Its Because of confusion.
Thanks a lot Manu , I got It.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
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 Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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