Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Logic to find the length of the SYSIN parameter

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Logic to find the length of the SYSIN parameter
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri May 16, 2008 12:34 pm    Post subject: Reply to: Logic to find the length of the SYSIN parameter
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

Site Director


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

PostPosted: Fri May 16, 2008 12:36 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10211
Location: italy

PostPosted: Fri May 16, 2008 12:40 pm    Post subject: Reply to: Logic to find the length of the SYSIN parameter
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts DDNAME parameter mistah kurtz JCL & VSAM 6 Mon Dec 19, 2016 4:41 pm
No new posts Execessive parameter issue Sumeendar JCL & VSAM 5 Mon Dec 19, 2016 4:35 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us