PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

*MAP,*DROP,*NOCHK

View previous topic View next topic Go down

*MAP,*DROP,*NOCHK

Post  soundhar on Thu Oct 14, 2010 10:23 am

Can anyone briefly Explain About the full functioning of *map,*drop,*no check with examples...Which case we have to use *Map,which case we hv to use *Drop and accordingly *NoCheck.

soundhar

Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai

View user profile

Back to top Go down

*map, *drop, *nochk

Post  Janani Ravikumar on Sat Dec 25, 2010 1:58 pm

*MAP is used in the case where you can add a field to your PF without data loss. (Using CPYF command)

*DROP is used in the case where you can remove a field from PF without data loss.(Using CPYF command)

*NOCHK is used in the case where you have to change the name of the particular field in your PF without data loss. (Using CPYF command)









Regards,
Janani .R.S.

Janani Ravikumar

Posts : 7
Join date : 2010-07-19

View user profile

Back to top Go down

Re: *MAP,*DROP,*NOCHK

Post  soundhar on Sun Jan 02, 2011 10:49 am

Thanks janani...
Detailed Explaination with examples
I have PF -Empmst with 2 fields with 100 records...
Now u want to add another one field to ur PF...
If u add the field,u have to compile and ur records will get deleted...
In this scenario we use *MAP...
If there is a increase in ur buffer size...
EMPMST
*************
R EMPREC
A EMPCDE 5S 0
A EMPNAM 25A
K EMPCDE
*************
RUNQRY *N EMPMST

EMPCDE EMPNAM
100 ANAND
101 BALA
.
.
.
.
199 SOUNDHAR
*****************
Now we want to add EMPDEP to EMPMST
CPYF FROMFILE(EMPMST) TOFILE(CPYEMPMST) CREATE(*YES)
Now CPYEMPMST will contain 100 records...
Now add a field EMPDEP in EMPMST
*******************
EMPMST
R EMPREC
A EMPCDE 5S 0
A EMPNAM 25A
A EMPDEP 2A
K EMPCDE
*******************
Compile EMPMST
RUNQRY *N EMPMST and check

EMPCDE EMPNAM EMPDEP
100 ANAND
101 BALA
.
.
.
.
199 SOUNDHAR
**************************
Now,
CPYF FROMFILE(CPYEMPMST) TOFILE(EMPMST) CREATE(*YES) REPLACE(*REPLACE) FMTOPT(*MAP)

UPDDTA EMPMST

EMPCDE 100
EMPNAM ANAND
EMPDEP __

EMPCDE 100
EMPNAM ANAND
EMPDEP IT

Like this update empdep for all employee details....

RUNQRY *N EMPMST
EMPCDE EMPNAM EMPDEP
100 ANAND IT
101 BALA EC
.
.
.
199 SOUNDHAR IT
....
....
....
*drop

To remove or delete a field from ur PF,we use *DROP...
If there is a decrease in ur buffer size...
Use above steps itself for *drop also...

*NOCHK
When we need a changes without affecting the buffer ie no increase or decrease in buffer size,we go for *NOCHK
For ex,changes in recfmt name,field name etc....


soundhar

Posts : 67
Join date : 2010-07-14
Location : Vridhachalam/chennai

View user profile

Back to top Go down

Re: *MAP,*DROP,*NOCHK

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum