How to copy source code of Pgm into Flatfile in COBOL
35 pts.
0
Q:
How to copy source code of Pgm into Flatfile in COBOL
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: Oct 22 2009  8:55 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1115 pts.
0
A:
 RATE THIS ANSWER
+2
Click to Vote:
  •   2
  •  0
  • AddThis Social Bookmark Button
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
Last Answered: Oct 23 2009  1:52 PM GMT by Wpoulin   1115 pts.
Latest Contributors: CharlieBrowne   6350 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Promodhss   35 pts.  |   Oct 23 2009  4:39AM GMT

Hi Bill Poulin,
Thanks for ur rly but i am not familiar in this. So can u plz give some examples.

 

MDratwa   285 pts.  |   Oct 23 2009  2:57PM GMT

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).

 

MDratwa   285 pts.  |   Oct 23 2009  3:04PM GMT

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.

 
0