how to create DDS of pf for given parameters
2 posters
Page 1 of 1
how to create DDS of pf for given parameters
I need help from you guys,
How can I create the DDS of a PF from given parameters,
The parameters are.Library name,Object name and Source file name.
Output: DDS of PF in any assigned library/Source file.
For this create a Command with will accept all the above parameter and finally create a DDS of PF.
Note: Don't suggest to do in CRTPF command, It will create only Flat PF. I want DDS Like record format name and fields..
How can I create the DDS of a PF from given parameters,
The parameters are.Library name,Object name and Source file name.
Output: DDS of PF in any assigned library/Source file.
For this create a Command with will accept all the above parameter and finally create a DDS of PF.
Note: Don't suggest to do in CRTPF command, It will create only Flat PF. I want DDS Like record format name and fields..
balaragunath- Posts : 1
Join date : 2012-09-13
HOW TO CREATE DDS OF PF FOR GIVEN PARAMETERS
Hi Bala,
Its interesting one, hey guys if u have object of the PF but source is not available how can we create.
Here is the solution for that. You need to do with CLP and RPGLE
Make two outfiles using DSPFD and DSPFFD. for example you have to create the outfile like below
Pass the parameter of original file object and its library.
DSPFFD FILE(&LIBNAME/&FILNAME) OUTPUT(*OUTFILE) OUTFILE(LIBNAME/FIELDOUT)
FIELDOUT is outfile name..Give the name whatever you want. after this command you runqry the outfile, you can get the field details related to that File name.
DSPFD FILE(&LIBNAME/&FILENAME) TYPE(*ACCPTH) OUTPUT(*OUTFILE) OUTFILE(LIBNAME/KEYOUT)
KEYOUT is outfile name..Give the name whatever you want. after this command you runqry the outfile, you can get the key field details related to that File name. Those commands are done with CLP and call the RPG program
Now you have fields and key field names in that out files.
After this step create a flat file.
Read the two outfiles get the details like record format name,len,type etc., and write all the details into flat file. Positioning the fields,attributes and Record format is important. Because if any one of the fields is not in right position then your DDS will be wrong..This will done in RPGLE program
After this copy the flat file into particular source file. for ex:
CPYF FROMFILE(LIBNAME/FLATFILENAME) +
TOFILE(LIBNAME/QDDSSRC) +
FROMMBR(*FIRST) TOMBR(&FILNAM) +
MBROPT(*REPLACE) CRTFILE(*YES) +
FMTOPT(*CVTSRC)
&FILNAM is nothing but original object of the PF which passing the parameter into this program.
Using this copy file now DDS of PF member has been create in that source file.
Now you open the file DDS will be available like original PF.
Its interesting one, hey guys if u have object of the PF but source is not available how can we create.
Here is the solution for that. You need to do with CLP and RPGLE
Make two outfiles using DSPFD and DSPFFD. for example you have to create the outfile like below
Pass the parameter of original file object and its library.
DSPFFD FILE(&LIBNAME/&FILNAME) OUTPUT(*OUTFILE) OUTFILE(LIBNAME/FIELDOUT)
FIELDOUT is outfile name..Give the name whatever you want. after this command you runqry the outfile, you can get the field details related to that File name.
DSPFD FILE(&LIBNAME/&FILENAME) TYPE(*ACCPTH) OUTPUT(*OUTFILE) OUTFILE(LIBNAME/KEYOUT)
KEYOUT is outfile name..Give the name whatever you want. after this command you runqry the outfile, you can get the key field details related to that File name. Those commands are done with CLP and call the RPG program
Now you have fields and key field names in that out files.
After this step create a flat file.
Read the two outfiles get the details like record format name,len,type etc., and write all the details into flat file. Positioning the fields,attributes and Record format is important. Because if any one of the fields is not in right position then your DDS will be wrong..This will done in RPGLE program
After this copy the flat file into particular source file. for ex:
CPYF FROMFILE(LIBNAME/FLATFILENAME) +
TOFILE(LIBNAME/QDDSSRC) +
FROMMBR(*FIRST) TOMBR(&FILNAM) +
MBROPT(*REPLACE) CRTFILE(*YES) +
FMTOPT(*CVTSRC)
&FILNAM is nothing but original object of the PF which passing the parameter into this program.
Using this copy file now DDS of PF member has been create in that source file.
Now you open the file DDS will be available like original PF.
arifg2005- Posts : 3
Join date : 2012-03-15
Age : 40
Location : Chennai
Similar topics
» How many types of parameters are there?
» What are the roles of parameters?
» Create usrprf from CLP
» ERROR WHEN PASSING PARAMETERS FROM COMMAND LINE
» How to use execute user source and to use parameters in this function?
» What are the roles of parameters?
» Create usrprf from CLP
» ERROR WHEN PASSING PARAMETERS FROM COMMAND LINE
» How to use execute user source and to use parameters in this function?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|