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

Converting COMP-3 to Character using Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top