INREC



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

INREC

Postby itamar rocha » Fri Nov 22, 2013 10:26 pm

Hi,
Good afternoon.
Somebody can explain this line below:

INREC FIELDS=(1,12,Z,13,5,X'0C',Z,18,11,8Z,C'?',X'0000',C'?',X'000000',C'?')

Thanks.
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INREC

 

Re: INREC

Postby BillyBoyo » Fri Nov 22, 2013 10:47 pm

INREC FIELDS is better as INREC BUILD

 INREC BUILD=(1,12,
              Z,
              13,5,
              X'0C',
              Z,
              18,11,
              8Z,
              C'?',
              X'0000',
              C'?',
              X'000000',
              C'?')


If arranged like that, you can see the separate "fields".

The "number pairs" (1,12 13,5 etc) are taking data from the input record - position 1, length 12, position 13, length 5. They appear on the record at the next available position, so 1,12 appears at position 1 on the output.

The single Zs are binary zeros. Hex '00'. The 8 in 8Z is a "repetition", so it means 8 bytes of binary zeros.

The C'?' is a character constant, a ? will appear at this position.

The X'0C' is a hexadecimal constant. It either represents zero as a one-byte packed-decimal field, or "12" as a one-byte binary field, or the EBCDIC hex code for Form Feed (FF), or it is a longer binary field in conjunction with the following Z, giving a binary zero - value 192. We can't tell which just from looking at the SORT Control Card.

The X'00... are hexadecimal constants. The first is two bytes of... binary zeros. The second is three bytes of binary zeros.

We can guess that the code was changed by someone who did not know what the Z was, and was not bothered to find out. The X'00..s could be replaced by 2Z and 3Z respectively.

Your output will be: 12 bytes from position one of input; a binary zero; five bytes from position 13 of input; X'0C'; one byte binary zero; 11 bytes from position 18 of input; eight bytes of binary zero; a question mark; two bytes of binary zero; a second question mark; three bytes of binary zero; a final question mark.

You should look all of this up in your documentation and make sure that you understand it all. Don't change the X'00..s without being told to. You can include a comment to describe the card and point out that the X'00.. and Z are doing the same thing (remembering that the repetition is important on the Z to get multiple bytes).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: INREC

Postby itamar rocha » Mon Nov 25, 2013 3:27 pm

Good morning.
Thank you.
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INREC

Postby itamar rocha » Tue Dec 10, 2013 9:51 pm

Hello,
I have a question,
When I use the line below:

inrec(5z,x'1c',z)

5z means bynary zeros, rigtht?

what means x'1c'?

Thanks.
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: INREC

Postby skolusu » Wed Dec 11, 2013 12:08 am

itamar rocha wrote:Hello,
I have a question,
When I use the line below:

inrec(5z,x'1c',z)

5z means bynary zeros, rigtht?

what means x'1c'?

Thanks.


X'1C' = + 1 in Packed Decimal format and since you had 5 binary zeroes to the left , you now have a 6 byte Packed decimal field with a value of +1
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: INREC

Postby itamar rocha » Wed Dec 11, 2013 4:39 pm

Hello,
Thanks for the answer.
itamar rocha
 
Posts: 41
Joined: Mon Nov 11, 2013 8:46 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post