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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Date reformatting
 Login/Join
 
Silver Member
posted
I have a bill date coming from a flat file dataset that I read in using...

-READ BILLDAT2 &BILLCONST.A8 &BILLDATE.A8 &FILL1.A26 &COMMWK.A2 &HAULERWK.A2 &PERIOD.A2 &PREVDATE.A8 &CURRDATE.A8;

&BILLDATE's value is 11272007

I don't understand why this is difficult, but I want to change the format to 20071127 and keep it numeric, while simply using -SET commands. I know this can be done inside a DEFINE, but I really wish I don't have to do that.

Please help!

Here is my sample code that doesn't work:
-READ BILLDAT2 &BILLCONST.A8 &BILLDATE.A8 &FILL1.A26 &COMMWK.A2 &HAULERWK.A2 &PERIOD.A2 &PREVDATE.A8 &CURRDATE.A8;
-*
-RUN
-SET &BILLYEAR = EDIT(&BILLDATE,'$$$$9999');
-SET &BILLMONTH = EDIT(&BILLDATE,'99$$$$$$');
-SET &BILLDAY = EDIT(&BILLDATE,'$$99$$$$');
-SET &BILLDATEA = &BILLYEAR|&BILLMONTH|&BILLDAY;
-SET &BILLDATEN = EDIT(&BILLDATEA);
-SET &CDATE = &BILLDATEN;

..and here is what I get when running it (notice the error GOTO doesn't make sense):
DYNAM ALLOC FILE BILLDAT2 DATASET NAVL.OPR.DATALIB(BILLDAT2) SHR REUSE
-RUN
-READ BILLDAT2 &BILLCONST.A8 &BILLDATE.A8 &FILL1.A26 &COMMWK.A2 &HAULERWK.A2 &PERIOD.A2 &PREVDATE.A8 &CURRDATE.A8;
-*
-RUN
SET PASS = EDWARD
SET ALL = PASS
SET ASNAMES = ON
-RUN
-*
-*-SET &CDATE = EDIT(&DATEYYMD,'9999$99$99');
-SET &BILLYEAR = EDIT(11272007,'$$$$9999');
-SET &BILLMONTH = EDIT(11272007,'99$$$$$$');
-SET &BILLDAY = EDIT(11272007,'$$99$$$$');
-SET &BILLDATEA = 20071127;
(FOC283) IMPROPER USE OF 'GOTO'

...as you can see the &BILLDATEA looks correct but I still comes back with this GOTO error.

Thanks in advance.


Thanks,
Ronnel C
WebFocus 7.1.5
IBM ZOS 1.6
 
Posts: 44 | Location: Fort Wayne, IN | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Use the CHGDAT function:

-SET &BILLDATE = '11272007';
-SET &BILLDATE1 = CHGDAT ('MDYY', 'YYMD', &BILLDATE, 'A17');

-TYPE &BILLDATE / &BILLDATE1


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
You can use most of the code that you have, just changed the concatenation to strong. Also, by definition, an amper variable is numeric so you don't have to do the conversion.

I also eliminated one of the edits since month and day are already in the right order.

-SET &BILLDATE=11272007;
-SET &BILLYEAR = EDIT(&BILLDATE,'$$$$9999');
-SET &BILLMODY = EDIT(&BILLDATE,'9999$$$$');
-SET &CDATE=&BILLYEAR||&BILLMODY;
-TYPE &CDATE
 


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
One wonderful line of code with the CHGDAT function.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Silver Member
posted Hide Post
Wow! That was amazingly simple.
I've seen this function before, but never used it, so I have forgotten all about it.

I knew it can't be that hard, I just need to know how to do it.

Thanks Francis!


Thanks,
Ronnel C
WebFocus 7.1.5
IBM ZOS 1.6
 
Posts: 44 | Location: Fort Wayne, IN | Registered: February 07, 2007Report This Post
Silver Member
posted Hide Post
That also worked Ginny!
Thanks as well!!!


Thanks,
Ronnel C
WebFocus 7.1.5
IBM ZOS 1.6
 
Posts: 44 | Location: Fort Wayne, IN | Registered: February 07, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders