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

Convert Decimal to Binary using SORT pgm


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Mon Jul 03, 2006 8:03 pm
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:

Use [URL] BBCode for External Links
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
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 Developer


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

PostPosted: Tue Jul 04, 2006 7:56 pm
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:

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top