From sourcefile to IFS and back..

2555 pts.
Tags:
CPYFRMSTMF
CPYTOSTMF
IBM 9407 M15
IFS
V6R1
I want to use CPYTOSTMF and CPYFRMSTMF commands to copy sourcemember to and fro the IFS. To test functionality, I created the following test:

Sourcemember A_1.TXT :

 

 FMT ** ...+... 1 ...+... 2 ...+... 3 ...+...

             *************** Beginning of data ****

0001.00 123456789_line number 1

0002.00 123456789_line number 2

0003.00 123456789_line number 3

             ****************** End of data *******


Copy above sourcemember to IFS:



CPYTOSTMF FROMMBR('/qsys.lib/mylib.lib/QALLSRC.file/A_1.mbr') TOSTMF('/temp/A_1.RPGLE') CVTDTA(*NONE) STMFCCSID(*PCASCII) ENDLINFMT(*CRLF)



(.. so far, so good :-)) ..

and back as sourcemember A_2 :



CPYFRMSTMF FROMSTMF('/temp/A_1.rpgle') TOMBR('qsys.lib/mylib.lib/qallsrc.file/A_2.mbr') MBROPT(*REPLACE) STMFCCSID(277)



RESULT:

 

 FMT ** ...+... 1 ...+... 2 ...+... 3 ..

             *************** Beginning of data

0001.00 123456789_line number 1

0002.00  123456789_line number 2

0003.00  123456789_line number 3

0004.00

           ****************** End of data **



Ooups.. line 2 and 3 are indented one character, and an extra line (4) has been added !!!!

Let's look a the new sourcemember with

'DSPPFM FILE(ADFO2SIMI/QALLSRC) MBR(A_2)' + F10 + F11:



 *...+....1....+....2....+....3....+....4...

000100000000123456789_line number 1 FFFFFFFFFFFFFFFFFFFFF6989849A98894F44444444 000100000000123456789D395505442590100000000

000200000000�123456789_line number 2 FFFFFFFFFFFF0FFFFFFFFF6989849A98894F4444444 000200000000A123456789D39550544259020000000

000300000000�123456789_line number 3 FFFFFFFFFFFF0FFFFFFFFF6989849A98894F4444444 000300000000A123456789D39550544259030000000

000400000000�

FFFFFFFFFFFF0444444444444444444444444444444 000400000000A000000000000000000000000000000



As can be seen, a hex 0A (position 13 in records 2,3 and 4) is the problem. What did I do wrong ?



Software/Hardware used:
9407/M15 running OS v6r1m0

Answer Wiki

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

DanTheDane 100 pts. | Sep 2 2009 2:15PM GMT

Through expriments, I succeded to solve this probl myself. Here are the two commandstrings that solved the problem:

CPYTOSTMF FROMMBR(’/qsys.lib/mylib.lib/QALLSRC.file/A_1.mbr’)
TOSTMF(’/temp/A_1.txt’)
CVTDTA(*NONE)
STMFCCSID(*PCASCII)
ENDLINFMT(*CR)

CPYFRMSTMF FROMSTMF(’//temp/A_1.txt’)
TOMBR(’qsys.lib/mylib.lib/qallsrc.file/A_2.mbr’)
MBROPT(*REPLACE)
STMFCCSID(277)

Thanks for any thoughts and comment :-)

_________________________________________________________________-

Perhaps you should use
End of line characters . . . . . *CRLF
on the CPYFRMSTMF
Phil

———————–
Sure – you’re solution works .. unless you edit this code using pc editors – not that you should.
They will add CRLF when you press the enter key.

Phil
—————————–
There is something attractive about having it in readable format.
Only alternative I can think of is FTPing a SaveFile — but I’m don’t know if that would have version/revision issues.
Phil
—————————–

Discuss This Question: 4  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
  • DanTheDane
    Through expriments, I succeded to solve this probl myself. Here are the two commandstrings that solved the problem:
    CPYTOSTMF FROMMBR('/qsys.lib/mylib.lib/QALLSRC.file/A_1.mbr')
              TOSTMF('/temp/A_1.txt')
              CVTDTA(*NONE)
              STMFCCSID(*PCASCII)
              ENDLINFMT(*CR)
    
     CPYFRMSTMF FROMSTMF('//temp/A_1.txt')
               TOMBR('qsys.lib/mylib.lib/qallsrc.file/A_2.mbr')
               MBROPT(*REPLACE)
               STMFCCSID(277)
    
    Thanks for any thoughts and comment :-)
    2,555 pointsBadges:
    report
  • Littlepd
    Do you mind if I ask why you want to do this? Just curious.
    1,130 pointsBadges:
    report
  • DanTheDane
    to Littlepd and others. I want to create a source transfer solution that can ease the task of having to work with 10+ systems with 5 different releases of os/400, and 3 different type of tapesystems . I hope to be able to attach IFS-files to an email, sebd it and save etcc vice versa. Any other ideas? PS: I am working as a consultant.
    2,555 pointsBadges:
    report
  • pdraebel
    Have you considered looking at WDSC?
    2,615 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