ice man tool ; outrec add extra col default 0 Pack dec



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

ice man tool ; outrec add extra col default 0 Pack dec

Postby Danielle » Thu Oct 01, 2009 10:02 am

Hi all,
would you please help !
use Iceman tool to sort the input file ,and in the outrec fileds I would like to
add 2 extra column (WHICH IS NOT IN THE INPUT FILE). Each fields define as pic s9(9)v comp-3 (this field takes 5 spaces)

I know how to add it in char fields and default it by space BUT don't know how to do if it is a pack decimal field and default it as zero ?
for ex1: in the output field after put input data in column 1 to 17, put extra column length of 5 and blank it by spaces will be:
sort fields=(1,9)
outrec fileds=(1,17;C' ')

BUT
ex2: if the extra columns both are define as pic s9(9)v comp-3 and default as zero how do I do it ??
I tried:

sort fields=(1,9)
outrec fields=(1,17;P'+00000';P'+00000')

It didn't work, I received error such as:

outrec fileds=(1,17;P'+00000')
$
ice111A L REFORMATTING FIELD ERROR
ICE005A M STATEMENT DEFINER ERROR


Please help ?

Thanks a lot
Danielle
Danielle
 
Posts: 8
Joined: Fri Aug 14, 2009 8:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ice man tool ; outrec add extra col default 0 Pack dec

Postby Frank Yaeger » Thu Oct 01, 2009 9:41 pm

The easiest way to do it would be with these DFSORT control statements:

  SORT FIELDS=(1,9,CH,A)                 
  OUTREC BUILD=(1,17,2X'000000000C')     


Alternatively, you could use:

  SORT FIELDS=(1,9,CH,A)                 
  OUTREC BUILD=(1,17,+0,TO=PD,LENGTH=5,+0,TO=PD,LENGTH=5)


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:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: ice man tool ; outrec add extra col default 0 Pack dec

Postby Danielle » Fri Oct 02, 2009 8:50 am

Hi Mr Yaeger
I tried it , it works ,
thanks a lot, really appreciate your help!

by the way if you don't mind would you please show me how do I code in the out rec fields
to convert an input filed of pic s9(9)v 9(6) comp -3 , at position say 18,lenght 9 to a 4 decimal field ie pic s9(9)v 9(4) comp -3 fields .
Since comp field takes 2 digits for 1 byte, so to pic s9(9)v 9(6) comp -3 takes 9 bytes, to chop off the last 2 decimal takes 1 byte off
there will be 8 bytes left so
I tried :
SORT FIELDS=(1,9,CH,A)
OUTREC BUILD=(1,8) <------ (out rec at position 1, length 8)

after submit the job it return o mean no error, but when I view this field in file-aid, it says 'Invalid' for the content of the field??
would you please help!
Thanks in advance
Have a nice day!
Danielle
Danielle
 
Posts: 8
Joined: Fri Aug 14, 2009 8:07 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ice man tool ; outrec add extra col default 0 Pack dec

Postby Frank Yaeger » Fri Oct 02, 2009 9:30 pm

An S9(9)V(6) COMP-3 field takes 8 bytes - for example, it might look like this in hex:

123456789123456C

An S9(9)V(4) COMP-3 field takes 7 bytes - for example, it might look like this in hex:

1234567891234C

If you want to remove the last two decimal digits, you can divide by +100. For example:

   SORT FIELDS=(18,8,PD,A)                         
   OUTREC BUILD=(18,8,PD,DIV,+100,TO=PD,LENGTH=7)   
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post