View previous topic :: View next topic
|
Author |
Message |
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
Hi All,
Please help me to resolve below syntax error.
The variable INIT-AMT is declared as PIC 9(03).9(06). When map the copybook in File-Aid the variable type is showing as 'ZE'. I want to convert this to packed decimal. My sort card is throwing syntax error.
Ex: Below is the copybook declaration.
Code: |
02 ISIP-STD-RATE-TBL.
03 GK-ID PIC X(03).
03 EFF-DT PIC 9(08).
03 INIT-AMT PIC 9(03).9(06).
03 INIT-PEROD PIC 9(05).
03 OVER-TIME-AMT PIC 9(03).9(06).
03 OVER-TIME-PRD-SEC PIC 9(05).
03 DUR-IND PIC X(01).
03 AMT-IND PIC X(01). |
Sort Syntax:
Code: |
SORT FIELDS=(1,3,CH,A,4,5,PD,A)
INREC FIELDS=(1,3,
4,8,ZD,TO=PD,LENGTH=5,
12,10,ZE,TO=PD,LENGTH=5,
*
22,5,ZD,TO=PD,LENGTH=3,
27,10,ZE,TO=PD,LENGTH=5,
37,5,ZD,TO=PD,LENGTH=3,
42,2)
WER268A INREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
Please help me to resolve this issue.
Thanks.! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
12,10,ZE,TO=PD,LENGTH=5, |
Is "ZE" a typo? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Also, I've edited your post to add BBcode tags -- please learn to use them. |
|
Back to top |
|
|
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
Thanks Dhawan.
When i opened my copybook in File-Aid the variable INIT-AMT is showing as 'ZE' type. Since i used this type in my sort card. pls let me know if i need to use any other type instead of 'ZE' in my sort card. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
File-Aid and DFOSRT are two different products and they don't talk to each other quite often, you know!
Try using UFF instead of ZE.
And you can call me Anuj -- I thought my name was quite easy, especially for Indians, however... |
|
Back to top |
|
|
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
When i opened this copy book with File-Aid, it is displaying as below.
Ref Field Name Picture Type Start End Length
**** Top of data ****
1 1 FILEMANAGER-DEFAULT-01 AN 1 43 43
2 2 ISIP-STD-RATE-TBL AN 1 43 43
3 3 GK-ID X(03) AN 1 3 3
4 3 EFF-DT 9(08) ZD 4 11 8
5 3 INIT-AMT 9(03).9(06) ZE 12 21 10
6 3 INIT-PEROD 9(05) ZD 22 26 5
7 3 OVER-TIME-AMT 9(03).9(06) ZE 27 36 10
8 3 OVER-TIME-PRD-SEC 9(05) ZD 37 41 5
9 3 DUR-IND X(01) AN 42 42 1
10 3 AMT-IND X(01) AN 43 43 1
**** End of data **** |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Please learn to use BBcode Tags.
Also try using UFF instead of ZE, as I said earlier. |
|
Back to top |
|
|
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
Thanks anuj...it is working fine, but data population is showing wrong for below scenario..
for 123.123456 it is populating in output as excepted in the same format.
for 123.123 it is populating as 0.123123.
as mentioned above the variable declaration is 9(3).9(6)... please help to resolve the issue |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
If the variable definition is 9(3).9(6), the data would have to be 123.123000 to conform to it, no? Do you have bad data or a bad copybook? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
latheef wrote: |
Thanks anuj...it is working fine, but data population is showing wrong for below scenario.. |
To err is human - and to blame it on a computer is even more so...
Are you sure the input has 123.123, as Sir John has pointed out? |
|
Back to top |
|
|
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
Yes, The varibale declaration is PIC 9(3).9(6). Some times we are receiving data like 123.123. our requirement is to load this data in a DB2 table. After sorting we are loading the data in to this table. It is loading in to table as 0.123123 whenever the input record having data like 123.123. Please help me to resolve the issue. Thanks. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
latheef wrote: |
Yes, The varibale declaration is PIC 9(3).9(6). Some times we are receiving data like 123.123. our requirement is to load this data in a DB2 table. After sorting we are loading the data in to this table. It is loading in to table as 0.123123 whenever the input record having data like 123.123. Please help me to resolve the issue. Thanks. |
In PIC 9(3).9(6), your values will look like this:
Code: |
123.123000
000.123123 |
And the code that has been suggested to you would work.
You don't get those values, so, although it is coded s PIC 9(3).9(6), that is not reflecting the contents of the field. It may as well be PIC X(10), as there is no PICture which represents a floating decimal-point.
That aside, it just means you need to do a little more to get your data. The easiest way to deal with it is probably with PARSE, but what you really need to do is to look at and extract from the data all the possible arrangements of the actual data (forget the PICture clause, look at the data).
What does zero look like? What does a number with no integer part look like? A number with no decimal part? Some decimal part, but fewer than six? Can you get an integer part with more than three digits? Everything.
You'll need that to work out how to treat it, and you'll need that if you still require assistance (and you'll need it in the Code tags, to preserve alignment. |
|
Back to top |
|
|
latheef
New User
Joined: 25 Sep 2009 Posts: 13 Location: chennai
|
|
|
|
Thanks Bill Woodger. Iwill try by using PARSE and let you know further updates. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
What does zero look like? What does a number with no integer part look like? A number with no decimal part? Some decimal part, but fewer than six? Can you get an integer part with more than three digits? |
latheef,
Do you mind answering the above? Along with that, Does your decimal point appear in the same position? If it is, you may not need a PARSE, probably a FINDREP from ' ' to '0' will do. It all depends on how your data will look like. |
|
Back to top |
|
|
|