× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I posted this on the RPG side since it involves RPG but, also, wanted to
post here because can be a pure CL problem.

There was a lot of discussion recently on the forums of the problems
that occur when you submit strings using CL and the SBMJOB command and
the string variables are longer than 32 characters.

At the time, I indicated that I was going to build a command that would
build the CALL strings without the compression and I have finally
finished. 

The command is called BLDCLLSTR and below the line is from the
readme.doc included in the zip. 

Note that the resulting variable gets passed through RQSDTA and is
limited to 3000 characters. 

I have created a zip containing a save file @ V5R2M0 and the source in
text for those who want to modify to work below V5R2M0. Only one
program.  

If you would like a copy, please send me an e-mail at
alan0307d@xxxxxxxxxxx 

Thanks.

------------------------------------------------------------------------

Normally, if you build a CALL command using SBMJOB in CL and if you have
a string variable, the variable will be trimmed to the length of the
data in the string. 

For example, if you have 50 character variable with:

'My Sister Sam                                   '

what gets passed to the new job is

'My Sister Sam'

and if the receiving program is expecting 50 characters, you get
garbage.

This problem does not occur if the string is less than 32 characters
because IBM always passes string variable with a minimum of 32
characters. The problem only occurs if you try to pass a string longer
than 32 characters.  

BLDCLLSTR just builds the CALL string without the blank compression. The
resulting command is then sent through on the RQSDTA parameter.

This is from test program TESTCMDP.

DCL        VAR(&QUOTE) TYPE(*CHAR) LEN(1) VALUE('''')                  

CHGVAR     VAR(&VARIABLE3) VALUE(&V92)

BLDCLLSTR  PGMANME(AGC/TESTCMDP2) PARMS((&QUOTE || +         
              &VARIABLE1 || &QUOTE) (&QUOTE || +              
              &VARIABLE2 || &QUOTE) (&QUOTE || +              
              &VARIABLE3 || &QUOTE)) RTNSTRING(&RTNSTRING)    

SBMJOB     JOB(TESTIT) RQSDTA(&RTNSTRING) LOG(4 00 *SECLVL)         
                                   
I just use the trick of putting quotes around the variables so that I
receive the true length. 




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.