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     create file for cobol

Read-Only Read-Only Topic
Go
Search
Notify
Tools
create file for cobol
 Login/Join
 
<Alberto>
posted
I want to create a file that has to be read by a cobol program.
The record of the file is:
1 field: aaa alphanumeric 1.
2 field: bbb packed (cobol 9(17) comp -3)
.....
I have already tried using SAVB but the lenght the first field is changed in 4 byte (three bytes blanck on the right).
thanks for any help
 
Report This Post
Expert
posted Hide Post
You should use SAVB FORMAT ALPHA to retain column lengths but you must use something like PCKOUT for your numeric value. Have a look in the Dev Studio help searching for PCKOUT in the index.
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Alberto>
posted
Thank you!!!
Now, I have another problem. In the file the numeric field is so stored:
Es: number 00127
017
02C
I want:
017
02F

Thanks
 
Report This Post
Expert
posted Hide Post
Alberto,

Why would you want to do that? the C is generally for positive numbers with D being for negative. I'm sure I remember the F from my mainframe days but can't remember the significance.
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
<Alberto>
posted
"F" is ussed when the number is without sign.
There is the problem because the field is the key in the file. When the cobol program read the file does not found the record.
I can't change the cobol program.
Thank
 
Report This Post
Platinum Member
posted Hide Post
Try this code. Good luck


-* CREATE A HOLD FILE WITH PACKED FIELDS
DEFINE FILE CAR
COSTP/P15=IF CAR EQ 'TOYOTA' THEN RETAIL_COST * (-1)
ELSE RETAIL_COST;
END
TABLEF FILE CAR
PRINT CAR COSTP
ON TABLE HOLD
END
-*CREATE OUTPUT ALPHA IN PACKED FORMAT COSTP_F
DEFINE FILE HOLD
COSTP_C/A8=PCKOUT(COSTP,8,'A8');
COSTP_C1/A16=UFMT(COSTP_C,8,'A16');
LB1/A1=EDIT(COSTP_C,'$$$$$$$9');
LB1C/A2=UFMT(LB1,1,'A2');
LB1NC/I3=BYTVAL(LB1,'I3');
OFFSET/I1=IF COSTP LT 0 THEN 2 ELSE 3;
LB1NF/I3=LB1NC + OFFSET;
LB2/A1=CTRAN(1,LB1,LB1NC,LB1NF,'A1');
LB2F/A2=UFMT(LB2,1,'A2');
COSTP_F/A8=EDIT(COSTP_C,'9999999')|LB2;
COSTP_F1/A16=UFMT(COSTP_F,8,'A16');
END
TABLEF FILE HOLD
PRINT CAR COSTP COSTP_C1 COSTP_F1
END
CAR COSTP COSTP_C1 COSTP_F1
--- ----- -------- --------
JAGUAR 8878 000000000008878C 000000000008878F
JAGUAR 13491 000000000013491C 000000000013491F
JENSEN 17850 000000000017850C 000000000017850F
TRIUMPH 5100 000000000005100C 000000000005100F
PEUGEOT 5610 000000000005610C 000000000005610F
ALFA ROMEO 6820 000000000006820C 000000000006820F
ALFA ROMEO 6820 000000000006820C 000000000006820F
ALFA ROMEO 5925 000000000005925C 000000000005925F
MASERATI 31500 000000000031500C 000000000031500F
DATSUN 3139 000000000003139C 000000000003139F
TOYOTA -3339 000000000003339D 000000000003339F
AUDI 5970 000000000005970C 000000000005970F
BMW 5940 000000000005940C 000000000005940F
BMW 6355 000000000006355C 000000000006355F
BMW 13752 000000000013752C 000000000013752F
BMW 14123 000000000014123C 000000000014123F
BMW 9097 000000000009097C 000000000009097F
BMW 9495 000000000009495C 000000000009495F
 
Posts: 115 | Location: Chicago, IL | Registered: May 28, 2004Report This Post
<Alberto>
posted
Thank you!!!!
 
Report This Post
Expert
posted Hide Post
As codermonkey mentioned in the topic "ON TABLE HOLD ... VIA program", this may help you.

http://techsupport.informationbuilders.com/tech/ibm/ibm_tmo_tm7810.html
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report 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     create file for cobol

Copyright © 1996-2020 Information Builders