I wasn’t able to find the mode, how it is possible to get (retrieve, punch/write, read…) a file content from PREDICT.
Especially I would like to retrieve the complete generated COBOL COPY Code.
What can I do?
I’m a newbie in Predict, so maybe this is a quite trivial issue, but I didn’t manage to find it in the documentation.
Predict can generate that for you.
[url]http://techcommunity.softwareag.com/ecosystem/documentation/natural/prd841/extobjects/gencob.htm#gencob[/url]
Or do you want to access the information programmatically?
[url]http://techcommunity.softwareag.com/ecosystem/documentation/natural/prd841/admin/api_over.htm#api_over[/url]
Once you’ve generated the copycode in Predict, you can use the PUNCH command to output it to work file 1 (//CMWKF01 DD in batch or TSO). See
http://techcommunity.softwareag.com/ecosystem/documentation/natural/prd841/reference/general_predict_commands.htm#PUNCH
See http://techcommunity.softwareag.com/ecosystem/documentation/natural/prd841/admin/bat.htm#bat if you need more information about running Predict in batch mode.
Thank you for the quick answer.
Nevertheless, the GENERATE is not the wanted process, because of since 20 years unknown settings and prefixes on the old copycodes. And, the PUNCH manage exactly 0 lines to punch to the workfile.An additional problem is, that Predict saved the copybooks as members, where the member name do not correspond to the copybook name.
Using the API to retrieve file information from Predict is simple enough, but I can tell you from experience that creating something that looks like a COBOL copybook takes quite a bit of effort.
Why not use the Generate function to create copybooks using member names of your choosing?
Then post your Punch parameters so that we can see where you went wrong.
to find the member name where a file/view’s copybook has been punched to, just display the file in Predict and the Generation status will show “COBOL COPY-CODE” -
19:30:11 ***** P R E D I C T ***** 2
- Display File -
File ID ............ EMPLOYEES
Type ............... Adabas userview
File number ........ 101 Added 2003-05-14
Modified 2016-07-03
Fields modified 2006-09-27
----------------------------------------------------------------------
--------------- Generation ---------------
Generation status on DBnr Fnr Warnings
Natural DDM 2004-03-12 274 100 Diff. to docu
Generation status on Library Member Warnings
COBOL COPY-CODE 2017-10-19 YSARKE COBEMPL
*** End of report ***
These were the “Output Options” I used to trim the report to the Generation status:
19:31:07 ***** P R E D I C T ***** 2017-10-1
Plan 0 - (FI) File Retrieval - Profile SYSTE
+Top-------Output options-----------+
Retrieval Type | current related|
| Description ....... N (Y,N) N |
D Files | No. abstract lines 0 (0-16) 0 |
E Execute retrieval models | Keywords .......... 0 (0-32) 0 |
C Dummy/Placeholder files | Extracts .......... 0 (0-32) 0 |
A Difference of files | Owners ............ 0 (0-99) 0 |
| with users .....* N N |
| Attributes ........ N (Y,N) N |
Retrieval type ... | Dummy/Placeholder * D N |
Output mode .....* D Display | |
| Association attr. .....* N |
File ID .......... EMPLOYEES | Mark implementation .... N (Y,N) |
Contained in DA .. | Show implementation .... Y (Y,N) |
External name .... | Display modifier ....... N (Y,N) |
Restrictions ....* Profile Default,emp | Use Conform ............ N (Y,N) |
Output options ..* T Temporary profile | Connecting character ... : |
| Cover page ............. N (Y,N) |
Command ===> | Page size .............. 60 |
|Command ==> +___ |
+More-------------------------------+
+More------Output options-----------+
| current related|
| Adabas attributes * N |
| Vista elements .... N (Y,N) |
| Subquery .......... N (Y,N) |
| Trigger ........... N (Y,N) |
| Check expression .. N (Y,N) |
| Display length ...* N |
| Synonyms .........* # |
| Composed fields ... (Y,N) N |
| 3GL specification . (Y,N) N |
| Generation layout . N (Y,N) |
| Adabas version * I7 |
| Language .......* CO |
| Alignment/sync. * N |
| Position/Offset * O |
| Counter length .. 2 (1,2) |
| Compiler .......* 7 |
| Replace with syn. Y (Y,N) |
|Command ==> +___ |
+More-------------------------------+
+More------Output options-----------+
| current related|
| Linked verification (Y,N) N |
| DV-field expression (Y,N) N |
| |
| |
You could be a bit clearer on what you want - are you trying to create copybooks from existing file/views in Predict or do you just want to export out the already-generated copybooks?
What version of Natural and Predict are you on?
Ralph and DOuglas, many, many thanks.
I’ ve managed all my problems (using PUNCH) because the colleagues 25 years ago used to set Punch/Output to “S” and so all membres were catalogized as members. I didn’t know it before and tried to get the contents of the old copy books in an another way (which I still don’t know, but as mentioned, it is not neccesary).
The reason of abandoning a new GENERATE is simple, that the old Copy Books particularly used today unknown prefixes and main-level names.