+ Reply to Thread
Results 1 to 8 of 8

Thread: Packed Fields

  1. #1

    Default Packed Fields

    To pass it directly you have to pass the parm in hex. Define *CHAR 5 DCL &DATE *CHAR 5 VALUE(x'020040109') or chgvar &DATE x'020040109' Notice the leading zero, it must be odd number of digits. The better way is to add a command fromt end to the HLL and declare the variable as *DEC and avoid the hex altogether.

  2. #2
    buck.calabro@commsoft.net Guest

    Default Packed Fields

    > Is it possible to pass a packed fields from CL to RPG. Packed is the only sort of number that CL understands. dcl &date *dec (8 0) call rpgpgm &date should work just fine. If you are doing it from the command line, take Daniel's advice and create a command to do it. --buck

  3. #3

    Default Packed Fields

    starbuck, thanks for correcting me. Brain freeze on my part. I was actually thinking of a call from a sbmjob. When hard coded in a call in CL your method is obviously better - replace the hard code with a CL variable. (or a command) The hex method works best when passing using sbmjob cmd(call ...) (but here, still, a command is even better)

  4. #4
    buck.calabro@commsoft.net Guest

    Default Packed Fields

    > starbuck, thanks for correcting me. Not a correction. The original problem description could certainly be interpreted either way. If I need to call any program (CL or RPG) from a command line/sbmjob I create a command, just as you recommend. The hex technique is good for one-off's, but not much fun if you have to do a lot of CALLs. I just thought I'd add my two cents in just in case Rod is trying to call an RPG program from a CL program, and not from a command line. --buck

  5. #5
    Guest.Visitor Guest

    Default Packed Fields

    What I am trying to accomplished here was to filled up a 256 parameters with chars and packed filled in CL before calling the RPG which uses the parm as Data Structure. I think this wont worked. I am using BPCS and wanted to run an interactive program in Batch Mode supplying all default parm. I think the position of the fields will fall off when pass to RPG programs. I will probably do it in RPG. Thanks anyway. Rod

  6. #6
    Guest.Visitor Guest

    Default Packed Fields

    Is it possible to pass a packed fields from CL to RPG. The RPG program accept date parm which is 8.0 and its in position on DS was 1 to 5. Thanks Rod

  7. #7

    Default Packed Fields

    This could certainly be done in CL, and you could *cat it all together and keep it aligned, but I think it'd be nasty. RPG sounds like the best bet by far.

  8. #8
    buck.calabro@commsoft.net Guest

    Default Packed Fields

    > I think the position of the fields will fall off > when pass to RPG programs. I have not worked with BPCS, but I have called RPG programs which use a DS as an input parameter from CL. That should not be a problem. But you already know that it will not be simple to construct a character version of a packed field using CL alone. But it is possible to do by deliberately mis-matching the parameters between two programs: PACK001 pgm dcl &date *dec (8 0) dcl &time *dec (6 0) dcl &amt *dec (15 5) dcl &char4 *char 4 dcl &char5 *char 5 dcl &char8 *char 8 chgvar &date 12312003 call pack002 (&date &char5) chgvar &time 173655 call pack002 (&time &char4) chgvar &amt 96322.153 call pack002 (&amt &char8) dmpclpgm endpgm PACK002 pgm (&charIn &charOut) dcl &charIn *char 5 dcl &charOut *char 5 chgvar &charOut &charIn endpgm Call PACK001 and look at the hex values of the various character fields. I suppose you could do the same thing if you used a single field and substring. >I will probably do it in RPG. Thanks anyway. RPG will be a better choice for this sort of string manipulation. Good luck! --buck

+ Reply to Thread

Similar Threads

  1. ODBC, SQL, and Packed Fields
    By M.Savino in forum General
    Replies: 2
    Last Post: 10-22-2003, 12:37 PM
  2. Unsigned Packed Fields
    By B.Morris in forum Visual Basic
    Replies: 4
    Last Post: 07-12-2002, 02:03 PM
  3. unpacking packed fields
    By Guest.Visitor in forum Application Software
    Replies: 18
    Last Post: 07-19-2000, 04:14 PM
  4. OPNQRYF w/packed fields
    By Guest.Visitor in forum Application Software
    Replies: 1
    Last Post: 03-08-2000, 07:14 AM
  5. FTP and packed fields
    By Guest.Visitor in forum Internet
    Replies: 2
    Last Post: 07-17-1998, 05:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts