How to get Signbit "C" in packed field of output file.



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

How to get Signbit "C" in packed field of output file.

Postby manisubbu » Fri Nov 13, 2009 12:19 am

Hi All,

I am getting "F" in output file when i moved input packed field to output packed field. i am validating the packed field in the program and changing the value if it satisfy particular condition according to the requirement.In output file i am getting the correct value except sign bit.

For Example:
123F instead of 123C.


Could any one help me to resolve the issue.
manisubbu
 
Posts: 2
Joined: Thu Nov 12, 2009 11:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get Signbit "C" in packed field of output file.

Postby Bill Dennis » Fri Nov 13, 2009 12:30 am

Aren't both acceptable? Why do you desire an 'C' ?
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get Signbit "C" in packed field of output file.

Postby dick scherrer » Fri Nov 13, 2009 4:05 am

Hello and welcome to the forum,

Is this happening in your own code or some utility (such as the sort)?

If this happens in your code, change the definition of the output field to be 9(n) instead of s9(n).

If this is a coding question or a utility question, we can move the topic to the appropriate part of the forum.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to get Signbit "C" in packed field of output file.

Postby manisubbu » Thu Nov 19, 2009 9:42 pm

It is coding question. I am writing Easytrieve program to change pack values in the input file to some other pack values if the input records matches specific condition.

For Example:

If the input file contains two types of record such as Type A and Type B. I need to change 5th field of the B type record (which is the packed variable) when it satisfies some condition otherwise I need to add the records in output file.

Sample Code:

File1 = Input file
Input –record 80 A

File2 = Output file
Output –record 80 A

GET File1
Do while until EOF file1
Move input-Record to output-Record
IF record type = ‘a’
Nop
Else
If record type = ‘b’
If 3rd pos = ‘c’
5th pos = packed value
End-if
End-if
End-if
Put File2
Get file1
End-Do

Case: 1
If B type records satisfy the above condition. I am passing packed value (50) to that field.
Case: 2
If B type records does not satisfy the above condition. I am writing the records to output file without changing the pack value.

Output:
For Case 1: I am getting ‘F’ in packed field
For Case 2: I am getting ‘C’ in packed fields which is same as input file.

Note: The packed field which I am changing contains “F” in the sign bit remaining Pack field Contains “C” in the sign bit.
manisubbu
 
Posts: 2
Joined: Thu Nov 12, 2009 11:21 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get Signbit "C" in packed field of output file.

Postby Bill Dennis » Thu Nov 19, 2009 10:19 pm

Perhaps Eztrieve has an option to choose which sign to use for PD data? Check the manual.
Regards,

Bill Dennis

Disclaimer: My comments on this forum are my own and do not represent the opinions or suggestions of any other person or business entity.
Bill Dennis
 
Posts: 278
Joined: Thu May 15, 2008 9:45 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to get Signbit "C" in packed field of output file.

Postby dick scherrer » Fri Nov 20, 2009 2:40 am

Hello,

How is the problem field defined?

Easytrieve uses the F-sign for unsigned data and the C-sign for signed data. There are some rules that are not obvious - for example if a numeric field has no decimal places it is assumed to be unsigned. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post