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
copy a row?
 Login/Join
 
Member
posted
I am a novice when it comes to FOCUS coding and hoping someone can help me. I am looking for the easiest way to copy a row into two rows from a hold file. Let me explain. If I have a row that meets certain criteria coming in from a hold file (in this case a code equals 'BIPD') I need to take that row and split it into two rows. The code that equals 'BIPD' will remain the same, however another code within that row will be updated/changed on the new row. I know I can do this with doing multiple hold files, however there has got to be a command to do this in one step. Any advice or help would be greatly appreciated. Thanks.
 
Posts: 13 | Registered: June 01, 2005Report This Post
Expert
posted Hide Post
well, by your having said you're a novice, we're limited in what we can answer you with. Us grizzled old-timers would MacGyver it, but thats not a technique for your freshman year.
you can write out 2 holds files and read them together a couple of different ways, either by using the MORE command or by using dialogue manager to -READ a flat file record by record and -WRITE it to some output file, doubling the write when your input record meets your criteria.
What i might suggest you do, if that multiple file thing doesn't appeal to you, is make a little tiny output file of just the valid criteria, doubled, then JOIN this file to your source file, effectively doubling the number of valid records in your resultant entity.
I think the multiple file thing is easier for you.
TABLE FILE CAR
PRINT *
ON TABLE HOLD AS H2
END
TABLE FILE CAR
PRINT * IF COUNTRY IS 'ENGLAND'
ON TABLE HOLD AS H1
END
TABLE FILE H2
PRINT *
ON TABLE HOLD AS H3
MORE
FILE H1
END
TABLE FILE H3 PRINT *
END
and you got yourself 2 Englands.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
If the file is not too big I think I would go for the -READ and multiple -WRITE option. Something like this:

-:read
-READ INFILE &CODE.A4. &REST.A256.
-IF &IORETURN NE 0 GOTO :end_read;
-WRITE &CODE&REST
-IF &CODE NE 'BIPD' GOTO :read;
-WRITE &CODE&REST
-GOTO :read
-:end_read
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders