How to copy source code of Pgm into Flatfile in COBOL

50 pts.
Tags:
AS/400
CL/400
COBOL
COBOL/400
I want to read the one of the pgm's source code through my another program. So anyone plz suggest me how can i read the source code?
ASKED: October 22, 2009  8:55 AM
UPDATED: October 23, 2009  3:04 PM

Answer Wiki

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

Read it like you would any other file.
You will need to do a OVRDBF to get the correct member.
Your source file will have 3 fields: SRCSEQ, SRCDAT, and SRCDTA.
The SRCDTA will have your COBOL statements

Promodhhs,

You could also use File Transfer to copy your source statements to a .txt file.

Hope this helps,
Bill Poulin

Promodhss,

File or Data Transfer is part of iSeries Access for Windows.
To Activate Wizard, Right click on your desktop,
Select New,
Select Data Transfer from iSeries Server,
Wizard should appear, Select Next,
Identify your iSeries Server Name, Select Next,
Identify the Library/File(Member) name, Select Next,
Identify Device, File, Select Next,
Identify File Name, (I usually use Browse), Select Next,
Here you can customize formating etc, just Select Next,
Select Finish. Transfer has been created.

To run Select Transfer data from iSeries,
Confirmation message should appear.

Hope this helps,
Bill Poulin

Discuss This Question: 3  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
  • Promodhss
    Hi Bill Poulin, Thanks for ur rly but i am not familiar in this. So can u plz give some examples.
    50 pointsBadges:
    report
  • MDratwa
    You can create a flat file with 80 char length (FILEA). Create a program (COBOL or RPG) reading a database file (QCBLSRC) and writing to FILEA (record length 80) from field "SRCDTA". Create a CL program with OVRDBF for QCBLSRC using yourlib/QCBLSRC mbrname, then call your program (COBOL or RPG), and DLTOVR QCBLSRC. The yourlib and mbrname can be a parm passed or hardcoded (for oneshot program).
    785 pointsBadges:
    report
  • MDratwa
    I tried "CPYF FROMFILE(mylib/QCBLSRC) TOFILE(TRASH/SRCDTA) FROMMBR(CRTFLATFL) MBROPT(*ADD) FMTOPT(*cvtsrc)", where "TRASH/SRCDTA" was created using "CRTPF FILE(TRASH/SRCDTA) RCDLEN(80)". It looked like it copied correctly.
    785 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