LIKEDS usage in RPGLE

Tags:
AS/400
RPGLE
Can we use LikeDS for external Describe File?
D FMT_DATA    PR
D  CTCD                        2A
D  WODS                            LIKEDS(WODS)
WODS is a E DS field in RPGLE.

Answer Wiki

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

Hi,

You can’t simple refer to EDS by using LIKEDS keyword. 
You should actually define a DS by mentioning its EXTNAME. And then you could use LIKEDS in parms list if you’d like to use different DS name in params.
Or, You could use same EDS in parms.
D WODS      E DS                  EXTNAME(WODS)
D FMT_DATA    PR
D  CTCD                        2A
D  WODS1                           LIKEDS(WODS)
or 
D FMT_DATA    PR
D  CTCD                        2A
D  WODS                            
Pradeep.

Discuss This Question: 3  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
  • rpgprogrammer2003
    Pradeep,  Option two will not work as W0DS is a E DS
    65 pointsBadges:
    report
  • rpgprogrammer2003
    Option 1, I am already using it but wanted to know is there any better way.  With Option1, you need to refer to the DS.Fieldname in the program or you need to keep moving values between two DS.
    65 pointsBadges:
    report
  • Splat
    rpgprogrammer2003, you can have multiple data structures based on same external file, e.g.:
    D File_0000 e Ds extname([physical file]) inz
    D Hold_0000 e Ds extname([physical file]) inz prefix(h_)
    

    It's a handy technique & one I use frequently.  One data structure can be set to the value of another quite easily, e.g.:
    Hold_0000 = file_0000;



    7,665 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