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
 
Parm sending the wrong value.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Jan 30, 2008 6:11 pm    Post subject: Parm sending the wrong value.
Reply with quote

Hello Everyone,

I am passing a string of 7 chars using PARM in my JCL to my cobol pgm. I have declared the varible in Linkage section. However I am getting my output not as expected. There are two spaces in my output which is ruining the output. I have attached the codes. Please take a look and suggest.

Thanks,
Anjani.[img][/img]
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Jan 30, 2008 6:16 pm    Post subject: Reply to: Parm sending the wrong value.
Reply with quote

Did You read the docs carefully ???
the length should come before the string like this ...
Code:
01  JCL-PARM.                                           
    03  PARM-LEN                PIC S9(04) COMP.   
    03  PARM-TEXT               PIC X(100).
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Jan 30, 2008 6:18 pm    Post subject: Reply to: Parm sending the wrong value.
Reply with quote

as usual I hit enter too quickly..

why blame others?

jcl as far as I can remember never made mistakes in passing parms

programmers usually made mistakes in retrieving them
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Wed Jan 30, 2008 6:19 pm    Post subject: Parm sending the wrong value.
Reply with quote

Move LS-VAR-LENGTH before LS-VAR-TEXT.

Validate LS-VAR-LENGTH and use it as the reference modification length when addressing LS-VAR-TEXT.

FWIW, define LS-VAR-TEXT as PIC X(100), which is the maximum length for a pass parm from JCL and always use LS-VAR-LENGTH as the reference modification length.

If you address LS-VAR-TEXT without using the reference modification length, you run the risk of raising a S0C4 Protection Exception.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Jan 30, 2008 6:37 pm    Post subject: Parm sending the wrong value.
Reply with quote

Thanks Enrico & Bill,

I have fixed the prob and its working fine now....Just wanted to confirm:

The parm can pass a length of 100 chars and the first 2 of the data that reach the application pgm contains the length of the char which has been passed. Am I correct?

Thanks,
Anjani.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10326
Location: italy

PostPosted: Wed Jan 30, 2008 6:39 pm    Post subject: Reply to: Parm sending the wrong value.
Reply with quote

Quote:
Am I correct?

Yesss !
Back to top
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Wed Jan 30, 2008 7:18 pm    Post subject:
Reply with quote

Thank you so much Enrico. Have a good day icon_razz.gif







Thanks,
Anjani.
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 sending email from jcl using the mail... niloyarp JCL & VSAM 5 Tue Oct 10, 2017 12:32 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm

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