Topic
3 replies Latest Post - ‏2013-03-20T00:42:58Z by BillWoodger
SystemAdmin
SystemAdmin
403 Posts
ACCEPTED ANSWER

Pinned topic Input File Help!! 'p' in input data file.

‏2013-03-17T22:44:24Z |
For a homework assignment I have to load in 2 files, in one of the files there is a "p". I'm not sure what this means. I've done some research and I found that when you write a pic clause a "P" means that the value is scaled up. I don't know what it means in my case and how i can use this 'p'. It is also giving me an 'illegal character in numeric field' error.
These are what the numbers in the data file represent.
Pos 1-3 Account number (Prime key)
Pos 4-10 Account Balance (2 decimals, signed)
Pos 11-17 Overdraft Amount (2 decimals)
Pos 18-18 Account Type

This is how i wrote my pic clause.
05 OM-ACCT-NUM PIC X(3).
05 OM-AMOUNT PIC 9(5)V99.
05 OM-OD-AMOUNT PIC 9(5)V99.
05 OM-ACCT-TYPE PIC X.
This is the data file...as you can see on the 4th line and 8th line there is a 'p'.
00100000000000000C
00300121000000000C
00401300120001000C
005000080p0010000S
00600045000010000S
00700100000000000S
00912000000012000S
011005230p0800000C
01400100120000000C
01500500000000000C
02002300000010000S
02200000000000000C
03400001000000500C
Updated on 2013-03-20T00:42:58Z at 2013-03-20T00:42:58Z by BillWoodger
  • SystemAdmin
    SystemAdmin
    403 Posts
    ACCEPTED ANSWER

    Re: Input File Help!! 'p' in input data file.

    ‏2013-03-17T22:52:44Z  in response to SystemAdmin
    Just found the solution...Silly mistake. I had to declare my PIC clause like this...
    05 OM-AMOUNT PIC S9(5)V99.
    The "S" in the PIC clause means that it is a signed field.
    • brataj
      brataj
      39 Posts
      ACCEPTED ANSWER

      Re: Input File Help!! 'p' in input data file.

      ‏2013-03-18T19:53:41Z  in response to SystemAdmin
      Don't know where you got the input file, but the "p" looks suspect because the upper nibble is a numeric (12-11 overpunch) rather than a simple 11 (negative) or 12 (positive) overpunch. I suspect that the problem might result from bad data or a mismatch between data and presumed format somewhere upstream of your program.
    • BillWoodger
      BillWoodger
      83 Posts
      ACCEPTED ANSWER

      Re: Input File Help!! 'p' in input data file.

      ‏2013-03-20T00:42:58Z  in response to SystemAdmin
      It would be interesting to know which compiler and operating system you are using.