File is not moving in folder

1355 pts.
Tags:
IBM iSeries
IFS Directory
Hi, I want to move a file which has a invoice no and create a sub-folder in /hame folder using the invoice number as the folder name. for example:
NAMEIN=/home/Indicium/20202021.pdf
Nameout=/home/Intellichief/20202021/20202021.pdf
PGM PARM(&NAMEIN &NAMEOUT)

    DCL VAR(&NAMEIN)  TYPE(*CHAR) LEN(50)
    DCL VAR(&NAMEOUT) TYPE(*CHAR) LEN(50)

    MOV OBJ(&NAMEIN) TOOBJ(&NAMEOUT) DTAFMT(*BINARY)
    MONMSG MSGID(CPF0000 CPE0000 MCH0000) 

return
After running my program I'm getting CPFA0A9 error (object not found)

Software/Hardware used:
software /hardware

Answer Wiki

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

Discuss This Question: 17  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
  • TomLiotta

    The program has two input parms, both 50 characters in length. In order to be confident of any cause, we need to know either the full text of the CPFA0A9 error message or the exact command that calls the program. If the calling command uses variables, we also need to know at least the exact definitions of those variables.

    Tom

    125,585 pointsBadges:
    report
  • 9783444184
    Yes ,i have same length of all variables.
    1,355 pointsBadges:
    report
  • CharlieBrowne

    Prior to your mov statement, add

    cd /

    41,380 pointsBadges:
    report
  • 9783444184
                                                                                  
    Message ID . . . . . . :   CPFA0A9                                             
    Date sent  . . . . . . :   10/23/13      Time sent  . . . . . . :   08:09:20   
                                                                                   
    Message . . . . :   Object not found.  Object is                               
      /home/Intellichief/20202021/20202021.pdf.                                    
                                                                                   
    Cause . . . . . :   Object /home/Intellichief/20202021/20202021.pdf, or a      
      directory in the object path, could not be found, or its type cannot be      
      resolved by this function.                                                   
    Recovery  . . . :   Correct the name or specify an object of the correct type.
      To determine if the object exists, use the  Work with Object Links (WRKLNK)  
      command. If the name exists, check the type of the object. If the name       
      contains symbolic link objects, ensure the path names they resolve to exist.
       Retry the operation.       

    after press F10                                               

    MOV OBJ('/home/Indicium/20202021.pdf') TOOBJ('/home/Intellichief/20202021/
    20202021.pdf') TOCCSID(*CALC)                                             
    Object not found.  Object is /home/Intellichief/20202021/20202021.pdf.    
    1,355 pointsBadges:
    report
  • CharlieBrowne

    Use the WRKLNK command to validate the path of the file.

    Then do you MOV command without variables from a command line,

    41,380 pointsBadges:
    report
  • Splat
    Where is the target folder created?
    7,235 pointsBadges:
    report
  • TomLiotta

    Yes ,i have same length of all variables.

    That doesn't matter. What matters is that you can show us the definitions. You need to copy/paste the definitions from the calling program. It needs to be a copy/paste because that will ensure that some detail isn't missed.

    If you only describe what your code says, we can't see if there is a possibility of an invalid character, e.g., a 'required-space' or a null character, at the end of the string. Some characters won't be visible, so we have to see actual definitions.

    Also, because the parms are greater than 32 characters, there is the possibility that your program was called from a command line or with SBMJOB or through some similar mechanism that would almost always cause invalid characters. If we can't see the calling mechanism, we have no way to know what might happen.

    We assume that you can run thess commands successfully:

    wrklnk '/home/Intellichief/20202021/*'
    wrklnk '/home/Intellichief/20202021/20202021.pdf'

    Tom

    125,585 pointsBadges:
    report
  • TomLiotta
    Those should be two separate commands. Code formatting gets tricky here sometimes. -- Tom
    125,585 pointsBadges:
    report
  • 9783444184
    hi,
    But i did Mov command direct from command line.and i got same message which i have given earlier.
    first of all mov command is not working from command line if that will success after that i will incorporate to my program.
    Thanks 
    1,355 pointsBadges:
    report
  • TomLiotta

    Then show us the results from the wrklnk '/home/Intellichief/20202021/*' and wrklnk '/home/Intellichief/20202021/20202021.pdf' commands.

    We have no way to know if the error is right or not. You need to show us evidence that the CPFA0A9 message shouldn't show up. For all we know, it's supposed to happen.

    However, it's impossible to run the same MOV command from a command line because you can't use program variables on a command line. The fact that a matching MOV command using lierals fails the same way your program fails is evidence that your program is correct. That means that the CPFA0A9 message is correct.

    So we don't know what your problem is. You can't move something that doesn't exist. Until we see evidence that it does exist and that the parms have correct values, you don't seem to have any problem.

    Tom

    125,585 pointsBadges:
    report
  • 9783444184
    Please find below evidence which i have followed
    ******************************************
                                                                                  
     Directory  . . . . :   /home/Indicium                                        
                                                                                  
     Type options, press Enter.                                                   
       2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes   
       11=Change current directory ...                                            
                                                                                  
     Opt   Object link            Type     Attribute    Text                      
           20202021.pdf           STMF                                            
    ************************************************
     Directory  . . . . :   /home/Intellichief                                  
                                                                                
     Type options, press Enter.                                                 
       2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes 
       11=Change current directory ...                                          
                                                                                
     Opt   Object link            Type     Attribute    Text                    
           20202021               DIR                                           
                                                                                
    ******************************************
    Type choices, press Enter.                                                    
                                                                                   
     Object . . . . . . . . . . . . . > '/home/Indicium/20202021.pdf'              
                                                                                   
     To directory . . . . . . . . . .   '.'                                        
                                                                                   
     To object  . . . . . . . . . . . > '/home/Intellichief/20202021/20202021.pdf' 
                                                                                   
     From CCSID . . . . . . . . . . .   *OBJ          1-65533, *OBJ, *PCASCII...   
     To CCSID . . . . . . . . . . . . > *CALC         1-65533, *OBJ, *CALC...      
     Data Format  . . . . . . . . . .   *BINARY       *BINARY, *TEXT               
                                                                                   
    ***************************************************
     Parameters or command                                                         
     ===> MOV OBJ('/home/Indicium/20202021.pdf') TOOBJ('/home/Intellichief/20202...
     F3=Exit          F4=Prompt             F5=Refresh            F6=Create        
     F9=Retrieve      F10=Command entry     F23=More options      F24=More keys    
     Object not found.  Object is /home/Intellichief/20202021/20202021.pdf.        
    *********************************************
                             Additional Message Information                        
                                                                                   
     Message ID . . . . . . :   CPFA0A9                                            
     Date sent  . . . . . . :   10/24/13      Time sent  . . . . . . :   02:32:17  
                                                                                   
     Message . . . . :   Object not found.  Object is                              
       /home/Intellichief/20202021/20202021.pdf.                                   
                                                                                   
     Cause . . . . . :   Object /home/Intellichief/20202021/20202021.pdf, or a     
       directory in the object path, could not be found, or its type cannot be     
       resolved by this function.                                                  
     Recovery  . . . :   Correct the name or specify an object of the correct type.
       To determine if the object exists, use the  Work with Object Links (WRKLNK) 
       command. If the name exists, check the type of the object. If the name      
       contains symbolic link objects, ensure the path names they resolve to exist.
        Retry the operation.                                                       
                                                                                   
    1,355 pointsBadges:
    report
  • TomLiotta

    Excellent. That gives us some hard data to work with.

    It leads us to a couple possibilities, one of which is that you might need a PTF from IBM. Let's see if we can eliminate one possibility.

    Put option 2=Edit against the 20202021 directory under the /home/Intellichief directory. After you press {Enter}, you'll be in an edit mode in the 20202021 subdirectory.

    Now, put some name like X.TMP in the 'New File' file field near the top of the display, and press {Enter}. That should put you in edit mode for the new file named X.TMP. (You can press F3 to exit without creating anything.)

    But before you press F3, look at the top of the display to see the exact value shown. It should say:

    Edit File: /home/Intellichief/20202021/X.TMP

    Make sure that there is nothing that looks unusual in the name. For example, there should be no embedded blanks in the path.

    This isn't a perfect test, but it can show some details that are hard to see. Let us know if some explanation is needed.

    Tom

    125,585 pointsBadges:
    report
  • 9783444184
    Yes ,
    I am getting
     Edit File: /home/Intellichief/20202021   /X.TMP                               
     Record :       1   of       1 by   8            Column :    1     59 by  74   
     Control :                                                                     
                                                                                   
    CMD ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+
         ************Beginning of data**************                               
                                                                                   
         ************End of Data********************                               
                                                                                   
                                                                                   
    1,355 pointsBadges:
    report
  • 9783444184
    Please let me know now how to solve this issue

    1,355 pointsBadges:
    report
  • TomLiotta

    Apparently the real name of the directory was created with spaces (invisible) at the end. If that is incorrect, then you should rename the directory. The simplest way might be on the WRKLNK display.

    Use option 7=Rename and type just the desired directory name into the prompt.

    Then try running your program again.

    You should also do some research on how that directory got its name. Some process is probably naming directories incorrectly.

    Tom

    125,585 pointsBadges:
    report
  • 9783444184
    Thanks Tom :)
    I am very happy
    1,355 pointsBadges:
    report
  • TomLiotta

    My apologies for asking for so much detail. This question shows an example of how difficult it can be to analyze a problem from a distance. Just coming up with a possible way to see the actual hidden problem can be difficult.

    But you did stick with it, and you posted the data that finally zeroed in on what was going wrong. You didn't give up when more info was requested, and it got us to an answer.

    Tom

    125,585 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