Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Convert Decimal to Binary using SORT pgm

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

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Mon Jul 03, 2006 1:12 pm    Post subject: Convert Decimal to Binary using SORT pgm
Reply with quote

Hi,

I have an input file of 50 containing.
XXXXXXXXXXYYYYYYYYYY123ZZZZZZZZZZZZZAAAAAAAAAAAAAA

I need to do the following
1) Move the characters/Numeric values before 123 to the output record
2) Convert 123 to COMP format and write it to the output record after 1).
3) And move the values after 123 tilll the end of file to the output record after 1) and 2).

I need to to do it with sort prgm.
Please help me out.

Regards
Sandhya
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jul 03, 2006 8:03 pm    Post subject:
Reply with quote

The following DFSORT job will do what you asked for. I assumed you wanted a length of 4 for the COMP field, but you can change the LENGTH if appropriate.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/50)
//SORTOUT DD DSN=...  output file (FB/51)
//SYSIN    DD    *
  OPTION COPY
  OUTREC FIELDS=(1,20,
    21,3,ZD,TO=BI,LENGTH=4,
    24,27)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Tue Jul 04, 2006 9:31 am    Post subject: Re: Convert Decimal to Binary using SORT pgm
Reply with quote

Thank you Frank,

I have tried it out and it worked good.

I had also seen TO=FI
Is this used for converting signed Decimals to COMP?

Sandhya
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jul 04, 2006 7:56 pm    Post subject:
Reply with quote

BI is unsigned (e.g. X'FFFF' = 65535). FI is signed (e.g. X'FFFF' = -1).

For more details on the various formats supported by DFSORT, and how DFSORT formats relate to COBOL data types, see Appendix C of "z/OS DFSORT Application Programming Guide". You can access it, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
sandhyaragav

New User


Joined: 05 Apr 2006
Posts: 14

PostPosted: Wed Jul 05, 2006 9:27 am    Post subject: Re: Convert Decimal to Binary using SORT pgm
Reply with quote

Thanks Frank for your quick response and help.
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 Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us