Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 10374
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: 10374
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 DUMMY When do I need add a DCB parameter Martylin JCL & VSAM 3 Fri Dec 08, 2017 7:20 am
No new posts Is CICS BMS logic on z/OS different ... Andi1982 CICS 2 Fri Dec 01, 2017 1:56 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
This topic is locked: you cannot edit posts or make replies. Selecting two copybooks of different ... Vignesh Sid COBOL Programming 8 Tue Sep 05, 2017 7:28 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us