Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Report from Copybook

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] Report from Copybook
 Login/Join
 
Platinum Member
posted
Hi All,

I got a requirement where i would need to create a report from the copybook and there is no input file.

The copybook would be like:

01 LAYOUT.
05 FIELD-1 PIC 9 VALUE 1.
05 FIELD-2 PIC X(5) VALUE 'FOCUS'.

I would need to display the values given in the copybook. For the above example the output for the above copybook should be:

1 FOCUS

I have given the above copybook as example, but i have a copybook which has around 200 fields, i would need to display all the fields with the respective values.

Could anyone help me.

This message has been edited. Last edited by: Vinay Kumar,


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
<FreSte>
posted
Hi,

Is it possible to dump the copybook to a flat-file ? If yes, you can filedef to it and with define/compute's you can get what you want
 
Report This Post
Platinum Member
posted Hide Post
Hi, it is possible to dump the copybook to a flat file. Could you pls give me an example on how to proceed with compute/defines?

1) We would be creating MFD for the copybook.
2) We would be dumping copybook to a flat file.

Is it correct?


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
<FreSte>
posted
You only need to dump the copybook to a flatfile, see below:


FILEDEF HLD1 DISK HLD1.MAS
-RUN
-WRITE HLD1 FILENAME=HLD1    , SUFFIX=FIX     ,$
-WRITE HLD1   SEGMENT=HLD, SEGTYPE=S0, $
-WRITE HLD1   FIELDNAME=LINE1, ALIAS=E01, USAGE=A250, ACTUAL=A250, $


-* --- Example copybook
FILEDEF HLD1 DISK HLD1.FTM
-RUN
-WRITE HLD1
-WRITE HLD1
-WRITE HLD1                  copybook INQINTC
-WRITE HLD1   Channel name
-WRITE HLD1   01 INQUIRY-CHANNEL  PIC X(16) VALUE 'inqcustrec'.
-WRITE HLD1   Container names
-WRITE HLD1   01 CUSTOMER-NO        PIC X(16) VALUE 'custno'.
-WRITE HLD1   01 BRANCH-NO          PIC X(16) VALUE 'branchno'.
-WRITE HLD1   01 CUSTOMER-RECORD    PIC X(16) VALUE 'custrec'.
-WRITE HLD1   Define the data fields used by the program
-WRITE HLD1   01 CUSTNO     PIC X(8).
-WRITE HLD1   01 BRANCHNO   PIC X(5).
-WRITE HLD1   01 CREC.
-WRITE HLD1     02 CUSTNAME   PIC X(80) VALUE 'FOCUS'.
-WRITE HLD1     02 CUSTADDR1  PIC X(80).
-WRITE HLD1     02 CUSTADDR2  PIC X(80).
-WRITE HLD1     02 CUSTADDR3  PIC X(80).


-SET &FINDWHAT = 'VALUE';
-SET &FINDLEN  = &FINDWHAT.LENGTH;



DEFINE FILE HLD1
  POS1/I2    = POSIT(LINE1, 250, '&FINDWHAT', &FINDLEN, POS1);
  VAL1/A40   = SUBSTR(250, LINE1, POS1+&FINDLEN, 250, ( 250 - (POS1+&FINDLEN) ), VAL1);
  CLEAN1/A40 = STRREP(40, VAL1  , 1, '''', 1, '', 40, CLEAN1);
  CLEAN2/A40 = STRREP(40, CLEAN1, 1, '.' , 1, '', 40, CLEAN2);
  CLEAN3/A40 = TRIM('B', CLEAN2, 40, ' ', 1, CLEAN3);
END

TABLE FILE HLD1
  PRINT
    VAL1
    CLEAN3
  WHERE LINE1 CONTAINS 'PIC' AND LINE1 CONTAINS 'VALUE';
END
-RUN
 
Report This Post
Platinum Member
posted Hide Post
FreSte,

when i am running your code, i am getting the below error

(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: HLD1
BYPASSING TO END OF COMMAND

Any idea?

HLD1.mas and HLD1.FMT files are created on disk!


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
<FreSte>
posted
I now see that you're on mainframe focus, so (I guess) the filedef doesn't work.
Should be something like DYNAM ALLOC etc etc

Don't know the exact syntax
 
Report This Post
<FreSte>
posted
... or maybe this ...
Use SYSTABLE to create the master and (empty) datafile.
I think this is platform independent.
It works on my windows-based laptop.

-Fred-


TABLE FILE SYSTABLE
  PRINT
    COMPUTE LINE1/A250 = '';
  BY NAME NOPRINT
  ON TABLE SET HOLDLIST PRINTONLY
  ON TABLE SET XRETRIEVAL OFF
  ON TABLE HOLD AS HLD1 FORMAT ALPHA
END
-RUN

-WRITE HOLDMAST FILENAME=HLD1    , SUFFIX=FIX     ,$
-WRITE HOLDMAST   SEGMENT=HLD, SEGTYPE=S0, $
-WRITE HOLDMAST   FIELDNAME=LINE1, ALIAS=E01, USAGE=A250, ACTUAL=A250, $


-* --- Example copybook
-WRITE HLD1
-WRITE HLD1
-WRITE HLD1                  copybook INQINTC
-WRITE HLD1   Channel name
-WRITE HLD1   01 INQUIRY-CHANNEL  PIC X(16) VALUE 'inqcustrec'.
-WRITE HLD1   Container names
-WRITE HLD1   01 CUSTOMER-NO        PIC X(16) VALUE 'custno'.
-WRITE HLD1   01 BRANCH-NO          PIC X(16) VALUE 'branchno'.
-WRITE HLD1   01 CUSTOMER-RECORD    PIC X(16) VALUE 'custrec'.
-WRITE HLD1   Define the data fields used by the program
-WRITE HLD1   01 CUSTNO     PIC X(8).
-WRITE HLD1   01 BRANCHNO   PIC X(5).
-WRITE HLD1   01 CREC.
-WRITE HLD1     02 CUSTNAME   PIC X(80) VALUE 'FOCUS'.
-WRITE HLD1     02 CUSTADDR1  PIC X(80).
-WRITE HLD1     02 CUSTADDR2  PIC X(80).
-WRITE HLD1     02 CUSTADDR3  PIC X(80).


-SET &FINDWHAT = 'VALUE';
-SET &FINDLEN  = &FINDWHAT.LENGTH;



DEFINE FILE HLD1
  POS1/I2    = POSIT(LINE1, 250, '&FINDWHAT', &FINDLEN, POS1);
  VAL1/A40   = SUBSTR(250, LINE1, POS1+&FINDLEN, 250, ( 250 - (POS1+&FINDLEN) ), VAL1);
  CLEAN1/A40 = STRREP(40, VAL1  , 1, '''', 1, '', 40, CLEAN1);
  CLEAN2/A40 = STRREP(40, CLEAN1, 1, '.' , 1, '', 40, CLEAN2);
  CLEAN3/A40 = TRIM('B', CLEAN2, 40, ' ', 1, CLEAN3);
END

TABLE FILE HLD1
  PRINT
    VAL1
    CLEAN3
  WHERE LINE1 CONTAINS 'PIC' AND LINE1 CONTAINS 'VALUE';
END
-RUN
 
Report This Post
Platinum Member
posted Hide Post
FreSte, i am not doing this in mainframe focus. I am working on WF 7.6.4. I will try the above code and let you know the output. Smiler


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
Platinum Member
posted Hide Post
Thanks FreSte! Your code worked! Smiler


WebFOCUS 7.6.4, Mainframe Focus
Windows XP, All Output Formats
 
Posts: 135 | Registered: November 30, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [Solved] Report from Copybook

Copyright © 1996-2020 Information Builders