EMPNAM allows to look up employees in EMPMST by their name, rather
that by their Employee Numbers.
Few months ago I was doing some maintenance and at some point created
a copy of EMPMST, named EMPMSTOLD. Apparently that switched EMPNAM to
point to EMPMSTOLD. If I look up File Description for EMPNAM it
clearly shows that EMPNAM is based on EMPMSTOLD.
Now I need to redirect the pointer in EMPNAM from EMPMSTOLD to EMPMST,
where it belongs.
Any suggestions will be appreciated, but I will only be able to
implement what I will understand, so, please, keep in mind that I have
very limited knowledge of the AS/400.
Thanks,
Naum
A logical will remain attached to the physical even when you move or
rename the physical.
Do a DSPDBR EMPMAST
and DSPDBR EMPMASTOLD
to see if there are any other logicals impacted.
Two choices.
1. Use RCTPF to recreate the logical file. This will require the
source for the logical, will delete the existing logical and recrate
it. This forum is too short to teach you all the ramifications of
CRTLF.
or
2. Use MOVOBJ to move both EMPMSTOLD & EMPNAM to a different libray
that NOT in a library list. Use OLDLIB for example. Then RNMOBJ
OLDLIB/EMPMSTOLD *FILE EMPMST to get it back to the orginal name. Then
CRTDUPOBJ OLDLIB/EMPNAM *FILE <ORIGINALLIB>
The new EMPNAM should attach to the correct EMPMAS.
Denny
No, no other logicals are impacted.
>
> Two choices.
>
> 1. Use RCTPF to recreate the logical file. This will require the
> source for the logical, will delete the existing logical and recrate
> it. This forum is too short to teach you all the ramifications of
> CRTLF.
> or
> 2. Use MOVOBJ to move both EMPMSTOLD & EMPNAM to a different libray
> that NOT in a library list. Use OLDLIB for example. Then RNMOBJ
> OLDLIB/EMPMSTOLD *FILE EMPMST to get it back to the orginal name. Then
> CRTDUPOBJ OLDLIB/EMPNAM *FILE <ORIGINALLIB>
> The new EMPNAM should attach to the correct EMPMAS.
>
> Denny
>
I run the 2nd choice. Everything was OK until the last command. New
EMPNAM in the new library indeed was pointing to the EMPMST. When
running last command, CRTDUPOBJ, I requested the data to be copied and
got an error message that the system can not copy the data. However,
when I checked the EMPNAM in the library where it should be, I saw the
file and it was pointing to correct PF, EMPMST. When I tried to run
the program which uses EMPNAM, however, I got an error message that
file EMPNAM is not found, despite the fact I could see it in the
correct library! I tried few different things and ended up losing
EMPNAM completely :( Now I am afraid I have no choice but recreate it
using CRTLF command. I looked up its description on the OS/400
documentation CD but did not find where I provide information about
the key field. I provide two file descriptions below, for EMPMST (PF)
and EMPNAM (LF) from one of many programs which uses both. May be you
can provide me with CRTLF parameters to recreate the file. I also
provide the DDS description for EMPMST, we do not have one for EMPNAM.
Perhaps I should create one and use it in CRTLF? (Not that I know what
to put there...)
What surprized me is that the key field, EMPNO is not listed in the
EMPMST "I" specs...
Thank you for your help...
FFilenameIPEAFBlenRlenLK1AIOvKlocEDevice+.......Exit++......A....U
FEMPMST IC F 128 128R 5AI 2 DISK
I*****************************************************************
I* EMPLOYEE MASTER FILE NAME.. EMPMST LABEL.. S.EMPMST
I*****************************************************************
I*
IFilenameSqNORiPos1NCCPos2NCCPos3NCC..............................
IEMPMST NS 10
I....................................PFromTo++DField+L1M1FrPoNeEq.
I 1 1 RIDEM
I 7 21 LSTNM
I 22 36 FSTNM
I 22 22 FSTIN
I 44 44 PROBAT
I P 46 490TJOBP
I P 50 530TJOBC
I 63 70 POSTNP
I 63 64 DPTNOP
I 71 78 POSTNT
I 71 72 DPTNOT
I 79 86 POSTNN
I 79 80 DPTNON
I 87 94 POSTNC
I 87 88 DPTNOC
I 117 117 SMRHLP
I P 118 1210WJOBP
I P 122 1242RCRAT
I P 125 1272EMPRAT
I NS 11
FFilenameIPEAFBlenRlenLK1AIOvKlocEDevice+.......Exit++......A....U
FEMPNAM ID F 128 128L16AI 7 DISK
I*****************************************************************
I* EMPLOYEES BY NAME FILE NAME.. EMPNAM LABEL.. S.EMPNAM
I*****************************************************************
I*
IFilenameSqNORiPos1NCCPos2NCCPos3NCC..............................
IEMPNAM NS 10 1 CA
I....................................PFromTo++DField+L1M1FrPoNeEq.
I 2 6 EMPNOA
I 7 21 LSTNMA
I 22 22 FSTINA
I 22 36 FSTNMA
I 63 70 POSTNP
I 63 64 DPTNOP
I 71 78 POSTNT
I 71 72 DPTNOT
I 79 86 POSTNN
I 79 80 DPTNON
I 87 94 POSTNC
I 87 88 DPTNOC
I NS 11
A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
A R REMPMST
A RIDEM 1A TEXT('RECORD ID (A) ')
A EMPNO 5S 0 TEXT('EMPLOYEE NUMBER ')
A LSTNM 15A TEXT('LAST NAME ')
A FSTNM 15A TEXT('FIRST NAME ')
A MIDIN 1A TEXT('MIDDLE INITIAL ')
A DATHIR 6S 0 TEXT('DATE-OF-HIRE ')
A PROBAT 1A TEXT('PROBATION STATUS ')
A FILLER1 1A TEXT('AVAILABLE ')
A TJOBP 7P 0 TEXT('TEMP JOB PREV WEEK ')
A TJOBC 7P 0 TEXT('TEMP JOB CURR WEEK ')
A PHONE 7S 0 TEXT('PHONE NUMBER ')
A HOLALW 1A TEXT('HOLIDAY ALLOWED ')
A FILLER2 1A TEXT('AVAILABLE ')
A POSTNP 8A TEXT('PERM ASSIGNMENT ')
A POSTNT 8A TEXT('TEMP ASSIGNMENT ')
A POSTNN 8A TEXT('NXT WK ASSIGNMENT ')
A POSTNC 8A TEXT('CUR WK ASSIGNMENT ')
A LNMDOH 14A TEXT('LAST NAME @ DOH ')
A RRNFET 7P 0 TEXT('RRN FIRST TRNHST ')
A RRNLET 7P 0 TEXT('RRN LAST TRNHST ')
A SMRHLP 1A TEXT('SUMMER HELP ')
A WJOBP 7P 0 TEXT('WKLY JOB PREV WEEK ')
A RCRAT 5P 2 TEXT('RED CIRCLE RATE ')
A EMPRAT 5P 2 TEXT('EMPLOYEE O/R RATE ')
A BMPALW 1A TEXT('BUMP ALLOWED ')
A K EMPNO
Looks like you are running 20 year old RPG II code. If this stuff is
running in S/36 mode, then I am not the guy you should be getting help
from. Should there really be an S dot in front of the file names?
The key is defined in the F spec. The 5AI 2 is five bytes oF Ascending
Iindex starting in position 2.
Try the CRTDUPOBJ command again. The DATA parameter only applies to a
physicla file. It is irrelevant for a logical file.
If you have the source for the Physical file you should have the
source for the logical.
It should look somthing like:
>A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
>A R REMPMST PFILE(EMPMST)
>A K LSTNM
Denny
2. I would try the CHGLF. If it doesn't work, try building the DDS
for the LF.
2. A guess on the EMPNAM dds would be
A PFILE(EMPMAS)
A R REMPMST
A K LSTNM
A K FSTNM
Check the keys listed on the "wrong" LF (you can use WRKF), and insert
above. Then use CRTLF.
> >
> I run the 2nd choice. Everything was OK until the last command. New
> EMPNAM in the new library indeed was pointing to the EMPMST. When
> running last command, CRTDUPOBJ, I requested the data to be copied and
> got an error message that the system can not copy the data. However,
> when I checked the EMPNAM in the library where it should be, I saw the
> file and it was pointing to correct PF, EMPMST. When I tried to run
> the program which uses EMPNAM, however, I got an error message that
> file EMPNAM is not found, despite the fact I could see it in the
> correct library! I tried few different things and ended up losing
> EMPNAM completely :( Now I am afraid I have no choice but recreate it
> using CRTLF command. I looked up its description on the OS/400
> documentation CD but did not find where I provide information about
> the key field. I provide two file descriptions below, for EMPMST (PF)
> and EMPNAM (LF) from one of many programs which uses both. May be you
> can provide me with CRTLF parameters to recreate the file. I also
> provide the DDS description for EMPMST, we do not have one for EMPNAM.
> Perhaps I should create one and use it in CRTLF? (Not that I know what
> to put there...)
>
>
arrowc...@bigfoot.com (Terence) wrote in message news:<440c28e5.04081...@posting.google.com>...
> 1. The CRTDUPOBJ with include data set to *YES requires exclusive use
> of the file, else it fails. Nobody else can have it open (even for
> read) or have it locked. If you use *NO, it doesn't require exclusive
> use.
>
> 2. I would try the CHGLF. If it doesn't work, try building the DDS
> for the LF.
>
> 2. A guess on the EMPNAM dds would be
>
> A PFILE(EMPMAS)
> A R REMPMST
> A K LSTNM
> A K FSTNM
>
> Check the keys listed on the "wrong" LF (you can use WRKF), and insert
> above. Then use CRTLF.
>
>
Thank you. I tried to build the DDS:
Data Description Source
SEQNBR *...+....1....+....2....+....3....+....4....+....5....+....6....+....
100 A PFILE(S.EMPMST)
* CPD7486-*
200 A R REMPMST
* CPD7529-*
300 A K LSTNM
400 A K FSTNM
* * * * * E N D O F S O U R C E * *
* * *
5763SS1 V3R2M0 960517 Data Description
ESLIB/
Expanded Source
SEQNBR *...+....1....+....2....+....3....+....4....+....5....+....6....+....
* * * * * E N D O F E X P A N D E D S O U R
C E * *
5763SS1 V3R2M0 960517 Data Description
ESLIB/
Messages
ID Severity Number
* CPD7486 20 1 Message . . . . : Keyword specified
at
incorrect level.
* CPD7529 30 1 Message . . . . : PFILE or JFILE
keyword not
found or ignored.
5763SS1 V3R2M0 960517 Data Description
ESLIB/
Message Summary
Total Informational Warning Error
Severe
(0-9) (10-19) (20-29)
(30-99)
2 0 0 1
1
* CPF7302 40 Message . . . . : File EMPNAM not
created in
I compared positions with a good DDS for a LF and I do not see the
problem! The good one compiles fine. Here it is:
FMT LF .....A..........T.Name++++++.Len++TDpB......Functions++++++++++++++++++
*************** Beginning of data
*************************************
0001.00 A UNIQUE
0002.00 A R RSFTVNC PFILE(S.SFTVNC)
0003.00 A K SVEMP
0004.00 A K SVDAT
0005.00 A K SVSFT
Yes, it is based on another file and has the UNIQUE function, but why
compiler is complaining about "Level"??
When (and IF) I get DDS compiled could I just run CRTLF?
naum....@sappi.com (Naum) wrote in message news:<c03ea355.04081...@posting.google.com>...