|
Dan, Kathir, I am not an RPG person but from what I remember, zoned is the same as zoned decimal in COBOL or in other words Display numeric so in COBOL FLD PIC 9(5) Value 12345 is F1F2F3F4F5 so simply passing the value to a PIC 9(n) field will work. The CL should define the value as *CHAR. -----Original Message----- From: Dan [mailto:dbcerpg@yahoo.com] Sent: Tuesday, January 07, 2003 11:47 AM To: COBOL Programming on the iSeries/AS400 Subject: Re: Parameter passing from CLP to COBOL/400 program I am certain there are better ways to accomplish your goal than I am going to suggest you try, but in case you need a solution now and better responses are slow in coming... Idea #1: Call the Cobol program with the parameter specified in hexadecimal. For example, if you wanted to use 123456 as the parameter value, you would use this: CALL COBOLPGM PARM( X'F1F2F3F4F5F6' ) Of course, if you are dealing with a variable, you might have to build the above command string and invoke it via QCMDEXC. I.e.: CHGVAR &CMD VALUE('CALL COBOLPGM PARM( X''' *CAT &HEXZONED *CAT ''' )' ) CALL QCMDEXC PARM( &CMD 100 ) You would have to figure a way to build the value for &HEXZONED. BTW, I'm not really sure the hex idea would work. Before you go coding to build the value for &HEXZONED, I would suggest you try a hard-coded call (the example call with the PARM( X'F1F2F3F4F5F6' )) Idea #2: If you have the RPG compiler, create an RPG program that takes the CL packed variable as an *Entry parameter, move that variable to a data structure subfield defined as zoned. (Question: Can you use a DS subfield as a parameter to call another program?) Non-ILE RPG may be the best to try as I think ILE-RPG defaults zoned definitions to packed internally. Maybe you can do a similar trick in Cobol? HTH, Dan --- Senkathiravan Athiappan <senkathiravan.athiappan@wipro.com> wrote: > Hallo - > > We need to pass a parameter from CLP to COBOL. > > The entry parameter in COBOL is of attribute- length 6 and type > Zoned. > > I have the limitation of not doing any change to the Cobol program. > > How should, I pass the Zoned field of length 6 from the CLP when I > call > the cobol program??? > > Pls., explain. > > Regards, > > Kathir __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com _______________________________________________ This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing list To post a message email: COBOL400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo.cgi/cobol400-l or email: COBOL400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/cobol400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.