View previous topic :: View next topic
|
Author |
Message |
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
You need to decide up on the size of WS-ADDR-PART4. Especially size of "<number/alphabet till spaces>". |
I believe not. . .
The code needs to be more flexible. It is not a good idea to dictate to the users what the "real" data will be. We (as developers) need to meet their need. . . We implement the business rules, not define them. . .
imho |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Quote: |
We implement the business rules, not define them. . . |
Depends upon how heavily armed you are, Dick. |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Lijo,
That is the problem. The P.O. BOX can come as following:
P.O. BOX A
P.O. BOX 234
P.O. BOX 11050
P.O. BOX 12
So I need to allocate WS-ADDR-PART4 atleast 20 bytes. We are declaring the WS variable not dynamically, right. So I am confused how we can decide upon the WS variable PIC size based on the data.
Can you please explain in detail. Sorry for that.
Thanks
Vinu |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Can there be more than 1 space between "P.O." and "BOX"? |
|
Back to top |
|
|
vinu78
Active User
Joined: 02 Oct 2008 Posts: 179 Location: India
|
|
|
|
Hi all,
I think the below code did the trick
Before the last line of code posted by Lijo, I have added this line of code to find the data length of P.O. BOX <num/alphabet>
i.e., after getting the P.O. BOX <num/alphabet> in WS-ADDRESS-POST4
Code: |
INITIALIZE K
PERFORM VARYING K FROM 35 BY -1
UNTIL WS-ADDRESS-POST4(K:1) NOT = SPACES
CONTINUE
END-PERFORM
INSPECT WS-DESC-CHK REPLACING ALL
WS-ADDRESS-POST4(1:K) BY SPACES |
I have tested and this works fine.
Thanks Lijo, Dick for your great amount of time and support.
Thanks
Vinu |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
The United States Post Office has a publication, number 28, that specifies everything you care to know about addresses. An address line, which could be a P.O. Box number, is recommended to be 30 bytes although 64 is considered optimum by the Post Office. If I recall correctly -- and I'm not sure I do -- 16 bytes is the absolute minimum you're allowed to use to meet U.S.P.S. standards. |
|
Back to top |
|
|
Lijo
New User
Joined: 24 Aug 2008 Posts: 41 Location: Cochin
|
|
|
|
Quote: |
I think the below code did the trick |
Good work Vinu... |
|
Back to top |
|
|
|