View previous topic :: View next topic
|
Author |
Message |
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Yesss ! |
|
Back to top |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
Thank you so much Enrico. Have a good day
Thanks,
Anjani. |
|
Back to top |
|
|
|