View previous topic :: View next topic
|
Author |
Message |
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 14
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 14
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
sandhyaragav
New User
Joined: 05 Apr 2006 Posts: 14
|
|
|
|
Thanks Frank for your quick response and help. |
|
Back to top |
|
|
|