Using command cpytomimpf

40 pts.
Tags:
CPYTOIMPF
IFS Directory
IFS Directory to iSeries Folder
Physical Files
V5R4
I am trying to use the command...I have pf that I need to copy to the IFS directory pcfiles. I can ge the file copied but receive òðñð`ññ`ðñ�@@�ð÷ööôôó�ùð@@�@@�ñóöõöô÷.... Operation system is V5R4MO. Any ideas why the ebcdic to ascii is not working, If I use client access to export the file,it works fine, but wanting to map a network drive to the directory to store these exported file.
ASKED: December 15, 2010  4:35 AM
UPDATED: December 16, 2010  8:25 AM

Answer Wiki

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

Please view the file in the folder from your PC .. using NOTEPAD.
Is it clear text?
Phil

Phil, no when open with NOTEPAD the data is not clear text.
Donna

Discuss This Question: 6  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
    Please show us the CPYTOIMPF command that you used. There are multiple possibilities. Without seeing the command, it will be a series of guesses. After seeing the command, there will probably be a couple more questions. A likely question is whether the target file existed at the time you ran the CPYTOIMPF command. Tom
    125,585 pointsBadges:
    report
  • Frenchconnect
    the first time that I tried the command I used. CPYTOIMPF FROMFILE(pwdcstm/hospirapf) TOSTMF('/pcfiles/hospira') MBROPT(*REPLACE) RCDDLM(*CRLF) DTAFMT(*FIXED) FLDDLM(*TAB). and NO I didn't have a target file that existed at the time I ran the CPYTOMIMPF command. Then I found this web sight http://www-01.ibm.com/support/docview.wss?uid=nas2d514e8d8eaa45cdf862572ac003c7e41, that had the following suggestion. After trying this it help but my numeric filed did not convert. some of the char field had extra " but at least it was a start. I think one of my issues was not haveing hte target file. Haven't found much info on the how to create the target file. 1) Using STRSQL to enter to interactive SQL session; create a table with a character data type, using the from-file ccsid, with the same length issued at the original from-file PF. > CREATE TABLE MYLIB/NEWFROM (F1 CHAR (192) CCSID 37 NOT NULL) 2) Exit STRSQL and issue the following command using the new created table. > CPYTOIMPF FROMFILE(MYLIB/FROMFILE) TOFILE(MYLIB/NEWFROM) FROMCCSID(37) DTAFMT(*FIXED) 3) Replace the from-file parameter of your original statement with your new from-file to export it to IFS. > CPYTOIMPF FROMFILE(MYLIB/NEWFROM) TOSTMF('/mylib/fromfile1.txt') STMFCODPAG(*PCASCII) RCDDLM(*CRLF) Donna
    40 pointsBadges:
    report
  • TomLiotta
    > CPYTOIMPF FROMFILE(MYLIB/NEWFROM) TOSTMF(’/mylib/fromfile1.txt’) STMFCODPAG(*PCASCII) RCDDLM(*CRLF) This is essentially the version of the command that I would use. The implication of the STMFCODPAG(*PCASCII) is either that the command will create the streamfile as CCSID 1252 or that the existing streamfile is CCSID 1252. (Standard Windows CCSID.) This assumes at least V5R3 and is true at V5R4. Make a decision whether or not your code will expect the streamfile to exist or not. I prefer creating the streamfile to be sure I get all of the attributes that are set in the code. That can mean issuing a command to delete any existing one first. But it's a matter of personal preference or the standards at your site. In addition to taking care of the STMFCODPAG(*PCASCII) parameter, the FROMCCSID() parameter may also need attention. If it's not explicitly specified, you should make sure that job and system defaults are appropriate. In order to populate the streamfile with correct bit patterns, the system needs to know all about how to interpret the input bit patterns. First place to start is the system QCCSID system value. If that has been left at the default 65535 value, then your job CCSID needs to be handled. You might choose to issue a CHGJOB CCSID( nnn ) before the CPYTOIMPF. I'd guess that you'd use CCSID(37). If you check your jobs and find that they're already running with the appropriate CCSID, that's probably an unnecessary command. But be aware that there are differences between the job's ' Coded character set identifier' and its 'Default coded character set identifier'. Don't get fooled into thinking that the job "default" will take care of everything because there's a good chance that it won't. If the job CCSID shows as 65535, you will probably want to control it explicitly no matter what the default claims. Next, look at the database file CCSID settings. You might want to review both DSPFD and DSPFFD to verify both file- and field-level settings. We're down to a level that's pretty unlikely to need adjustment, but you should become aware of them for any data elements that will be transferred as text to any other system. Bit patterns on one system may have entirely different meanings on another system. Binary data (e.g., an image file) is not sensitive to different encoding schemes between systems, but text (character data) is. EBCDIC to ASCII changes bit patterns. Even EBCDIC to EBCDIC will have conversions for different character sets (language alphabets). After trying this it help but my numeric filed did not convert. I'm not sure what that means. Is your input file an externally-described database file? Can you post the field description of a numeric field that didn't "convert"? The field description should be copied from DSPFFD. some of the char field had extra ” but at least it was a start. And an example of this from the streamfile line should lead to an explanation. Just use DSPF to display the streamfile and copy a portion of the line that shows any extra or unexpected characters. Tom
    125,585 pointsBadges:
    report
  • Frenchconnect
    Thank You, for your help, not sure if this was the best way to handle what I needed to get done but, here is the way I was able to work through it. First - I created a Physical file as a *SRC Second - CPYTOIMPF FROMFILE(PWDCSTM/HOSPIRAPF) TOFILE(PWDCSTM/HOPIRDATA) RCDDLM(X'07') DTAFMT(*FIXED) STRDLM(*NONE) Third - CPYTOIMPF FROMFILE(PWDCSTM/HOSPIRDATA *FIRST) TOSTMF('/PCFILES/HOSPIRA2.TXT') MBROPT(*REPLACE) STMFCODPAG(*PCASCII) RCDDLM(*LF) DTAFMT(*FIXED) STRDLM(*NONE) Then file is located in the folder that can be seen on a network drive and data then can be opened in excel.. Again thank you
    40 pointsBadges:
    report
  • TomLiotta
    I created a Physical file as a *SRC If it's a source file rather than externally-described database file, you probably shouldn't be using CPYTOIMPF. The CPYTOSTMF command is probably more appropriate. The CPYTOIMPF (Copy to Import File) is better suited for database import and export functions. If the original file isn't a database file, then the import/export capability isn't relevant and probably just complicates things. Exactly what are you trying to transfer? Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    I just read your last post again, and maybe I see what was going on with it. It took a couple reads. You have a file named PWDCSTM/HOSPIRAPF that you want to export for some other system, e.g., PCs on your LAN. Can you run DSPFFD for that file and post the field descriptions here? Of course, if you got a "satisfactory" result and don't need to pursue it farther, we can let it go. 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