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

DFsort convert from hex/bin to character


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Aug 16, 2006 4:13 am
Reply with quote

You can use these DFSORT steps to get the date from file1 and use it in file2:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file with date (FB)
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
* Create DFSORT symbol as:
* MYDATE,'yy/mm/dd'
  OPTION COPY,STOPAFT=1
  OUTREC BUILD=(C'MYDATE,''',4,8,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  ...
  OUTREC FIELDS=(C'IRO',
                 C'   ',
                 MYDATE,
                 ...
/*



You don't need all those IFTHENs to replace each 'A' in a field with a blank. Instead, you can use DFSORT's TRAN=ALTSEQ feature as follows:

Code:

   ALTSEQ CODE=(C140)
   OUTREC ...
   ...
   p,m,TRAN=ALTSEQ,
   ...


where p is the starting position and m is the length.

For more information on using TRAN=ALTSEQ, see the "Change all zeros in your records to spaces" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/index.html

To learn more about all the things you can do 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
yianis

New User


Joined: 14 Aug 2006
Posts: 45

PostPosted: Wed Aug 16, 2006 5:31 pm
Reply with quote

Thanks... works like a charm !!!
Back to top
View user's profile Send private message
cheetz007

New User


Joined: 10 Aug 2006
Posts: 23

PostPosted: Wed Aug 23, 2006 2:21 am
Reply with quote

Frank - you ARE the DFSORT man! Can't argue with that.
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top