Packed fields in Flat Files

260 pts.
Tags:
AS/400
Flat files
OS/400
I have a flat 400 file wich is 36 long internally described as follows: 1 2 0ICL 3 6 0ORDNO 7 8 0SUB 9 11 0DEPT P 12 13 2RATE P 14 18 2TOTMTH P 19 23 2OTODAT P 24 28 1HRS2DT 29 36 0INFODT I creasted alogical as follows: R DLLOHD PFILE(DLPLOHD) ICL I SST(DLPLOHD 1 2) ORDNO I SST(DLPLOHD 3 4) SUB I SST(DLPLOHD 7 2) DEPT I SST(DLPLOHD 9 3) RATE I SST(DLPLOHD 12 2) TOTMTH I SST(DLPLOHD 14 4) OTODAT I SST(DLPLOHD 19 4) HRS2DT I SST(DLPLOHD 24 4) INFODT I SST(DLPLOHD 29 8) K ICL K ORDNO K SUB When I view its contents I see: ....+....1....+....2....+....3....+....4....+....5....+....6. ICL ORDNO SUB DEPT RATE TOTMTH OTODAT HRS2DT INFODT 01 4035 30 221 *¬ *Ä * 20080602 01 4035 98 221 *¬ * 20080602 01 4040 00 001 *¬ 20080602 01 4042 00 001 *¬ 20080602 01 4043 00 001 *¬ 20080602 I can not see the packed fileds! HELP! How can I see the contents of a packed field in a flat file? Thanks, John
ASKED: June 3, 2008  3:27 PM
UPDATED: April 24, 2010  9:20 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi John,

Simple method is to create another (physical) file with the same fields, but with non-packed decimals and do a CPYF with FMTOPT(*MAP *DROP). This should give you a copy of the file without packed fields.

Regards,

Martin Gilbert.

===========================================================

<i>How can I see the contents of a packed field in a flat file?</i>

To see the values, simply press <F10=Display hexadecimal> when you run the DSPPFM command.

Tom

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • BigKat
    Actually, since it is a flat file containing packed data, shouldn't he create a physical file with the defined layout including the PACKED fields and do a CPYF with FMTOPT(*NOCHK)???
    7,565 pointsBadges:
    report
  • graybeard52
    Yes - BigKat has the correct answer. One other option is to write a RPG program that reads the flat file and writes to the new external file. Writing a LF over the flat is not going to work with packed fields.
    3,115 pointsBadges:
    report
  • Gilly400
    Hi, BigKat is right - I thought the idea was to get a flat file from a physical with packed fields, but it's the other way around. By the way - this is starting to look like a beards only answer :-) Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Bmangan
    John, Another way to view the packed data is while in DSPPFM you can use F10 and F11 and that would display the hex data top to bottom. Hope this helps. This option are shown is you use the F24 more keys option. Regards, Bryan
    285 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following