View previous topic :: View next topic
|
Author |
Message |
barthwalsamarth
New User
Joined: 03 Aug 2006 Posts: 9
|
|
|
|
Hello,
Can any one help me understand this logic to find the length of the SYSIN parameter in COBOL program
Code: |
CALCULATE-TEXT-LENGTH
add 1 to ZERO giving IX-1
inspect SYSIN-PARAMETER replacing all LOW-VALUES by SPACES
perform 80 times
if SYSIN-PARAMETER(IX-1:1) not = SPACE
add IX-1 to ZERO giving SYSIN-LENGTH
end-if
add 1 to IX-1
end-perform
exit.
|
What my understanding is
1. We read SYSIN data from JCL into a Working storage variable of length 80.
2. After we read the SYSIN into the WS varaible, why will it have low values. As the code says
Code: |
inspect SYSIN-PARAMETER replacing all LOW-VALUES by SPACES
|
Infact it should have spaces that too at random places.
Fianlly how is this logic working?
Thanks |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
odd naming convention to use ZERO as a variable name |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can any one help me understand this logic to find the length of the SYSIN parameter in COBOL program |
If there are any embedded spaces, the code will fail.
Quote: |
odd naming convention to use ZERO as a variable name |
And i believe it will cause a compile error as an invalid "receiving" field.
Quote: |
After we read the SYSIN into the WS varaible, why will it have low values. |
This would depend on how the data was created. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
if the sysin is a true sysin
- card_image/text data created with an editor
there is no reason to have low values in it there should be only printable chars
but... who knows?? |
|
Back to top |
|
|
|