IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Logic to find the length of the SYSIN parameter


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
barthwalsamarth

New User


Joined: 03 Aug 2006
Posts: 9

PostPosted: Fri May 16, 2008 12:23 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 16, 2008 12:34 pm
Reply with quote

odd naming convention to use ZERO as a variable name icon_eek.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 16, 2008 12:36 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri May 16, 2008 12:40 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
Search our Forums:

Back to Top