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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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