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
 

 

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: 10256
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: 10256
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: 2502
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: 10256
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 Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
No new posts Using 'parm' to vary SORTOUT record v... Sysaron DFSORT/ICETOOL 13 Wed Sep 07, 2016 9:24 pm
No new posts Copy a particular column based on PAR... brindhamohan DFSORT/ICETOOL 5 Wed May 11, 2016 8:49 am
No new posts Use of Parm in SORT Ambili S DFSORT/ICETOOL 2 Mon May 09, 2016 9:16 pm
No new posts How to sending system service request... lind sh IMS DB/DC 5 Sun Apr 10, 2016 12:02 am


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