Todd Van Valkenburg Posted February 5, 2021 Share Posted February 5, 2021 Hello. I have a situation where the fex that creates a permanent hold file was recently changed which also changed the underlying segment name of the hold file. So the pre-existing fexs that were built using the hold file are no longer working. So besides changing the fex reports manually to reference the new segment name (which is do-able), I was wondering if there are any commands when creating a binary hold file that allows you to specify an explicit segment name. I checked the online manual but nothing jumped out at me with regards to segment naming. On version 8202M. Thank you! Todd Link to comment Share on other sites More sharing options...
Warren Hinchliffe Posted February 7, 2021 Share Posted February 7, 2021 What is the format (SUFFIX in the master) of the binary file Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 8, 2021 Author Share Posted February 8, 2021 The SUFFIX=FIX. FILENAME=HOLD_PM_BASE_DATA, SUFFIX=FIX , DATASET=hr/hr_hold/hold_pm_base_data.ftm (LRECL 720 RECFM F, IOTYPE=BINARY, $ SEGMENT=HOLD_PM_, SEGTYPE=S37, $ Link to comment Share on other sites More sharing options...
Toby Mills Posted February 8, 2021 Share Posted February 8, 2021 Hi Todd I dont have a good answer off the top of my head for specifying a segname in the HOLD part of a TABLE request, but I have another idea. If your master doesnt change, but the data does, maybe only re-create the data part (not the master) in your real file location (hr/hr_hold) with APP HOLDDATA The APP HOLDDATA command designates an application as the location for storing data files created with the HOLD command. For related information, see Interactions Among Output Redirection Commands on page 101. Syntax: How to Designate a Storage Location for Data Files APP HOLDDATA appname[/appnamea] where: appname[/appnamea] Is the name of the location for the data files created by any write process in the application. It can be a nested application name So for you, maybe leave your master file alone and do: APP HOLDDATA hr/hr_hold when youre about to create your permanent HOLD file. Just make sure you remove any APP HOLD statements that might come before this so you dont accidentally recreate the master file part. Of course if your fieldnames change inside the segment, then this idea wont be sufficient. In that case, it would be easier to just remove the segnames from your focexecs that read this table. There are more things you can do, like read the generated master and the STRREP the segname, but that starts sounding more like a hassle. Hope the HOLDDATA might work for you. Toby Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 8, 2021 Author Share Posted February 8, 2021 Thanks Toby. I was not aware of APP HOLDATA. So I am trying it just to learn more about it. I removed: ON TABLE HOLD AS hr/hr_hold/hold_pm_base_data_test FORMAT BINARY I added APP HOLDDATA hr/hr_hold/hold_pm_base_data_test at various points in the fex and tried running it since I wasnt sure where to place it. When it did run, I used App Studio to sample the data but I did not see the data changes (I added a WHERE clause to select one record). The segment name did not change which was good. But I would like to prove that the data was updated. My last test was to place the command at the end of the fex between -RUN commands. e.g. BY POSN_ECLS_GROUP WHERE J001.NBBFISC.NBBFISC_ACTIVE_IND EQ Y; END -RUN APP HOLDDATA hr/hr_hold/hold_pm_base_data_test -RUN Todd Link to comment Share on other sites More sharing options...
David Beagan Posted February 8, 2021 Share Posted February 8, 2021 APP HOLD goes before the TABLE FILE. Here is an example: APP HOLDDATA hr/hr_hold TABLE FILE ibisamp/car PRINT COUNTRY CAR MODEL ON TABLE HOLD AS HOLD_PM_BASE_DATA FORMAT BINARY END Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 8, 2021 Author Share Posted February 8, 2021 I tried this just now. But the segment name did change for me. So what I did was 1) create the permanent hold file in the hr/hr_hold; 2) Renamed the segment to HOLD_PM_BASE_DATA_TEST; 3) Ran it again but this time with APP HOLDATA hr/hr_hold; 4) checked the mas file and the segment name was reverted back to HOLD_PM_ as shown below. FILENAME=HOLD_PM_BASE_DATA_TEST, SUFFIX=FIX , DATASET=hr/hr_hold/hold_pm_base_data_test.ftm (LRECL 52 RECFM F, IOTYPE=BINARY, $ SEGMENT=HOLD_PM_, SEGTYPE=S0, $ FIELDNAME=COUNTRY, ALIAS=E01, USAGE=A10, ACTUAL=A12, $ FIELDNAME=CAR, ALIAS=E02, USAGE=A16, ACTUAL=A16, $ FIELDNAME=MODEL, ALIAS=E03, USAGE=A24, ACTUAL=A24, $ Todd Link to comment Share on other sites More sharing options...
Toby Mills Posted February 9, 2021 Share Posted February 9, 2021 Hi Todd, I think youre getting warmer! I suspect you have an APP HOLD hr/hr_hold someplace already. Otherwise your master shouldnt change. If youve got an APP HOLD command pointing to this same folder, comment that out before running your fex. I presume (but havent tested) that you can just say APP HOLD with no parameters and itll go back to holding in edatemp. You can also check out APP HOLDMETA (this is like HOLDATA but it controls where your master will end up). Let us know if you find that youve got an APP HOLD hr/hr_hold rolling around before your TABLE FILE request. Thanks! Toby Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 10, 2021 Author Share Posted February 10, 2021 Hi Toby, I did what David Beagan mentioned except I specified a directory path for the hold file. No luck. Anyway, I will not pursue this any longer since I can alter the fexs that were created in the past and change the segment name to make it work. But I appreciate the suggestions. Todd Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted February 10, 2021 Share Posted February 10, 2021 Hi Todd One thing you can consider for the future is with App Studio under the Reporting options you can use unqualified names when creating reports and graphs which will only reference field names and not the full table and segment names. There are probably some pros and cons for using qualified names but it is something to consider so you dont have to make changes to code if the segment names change. Also if you make that change to the reporting options and open your fex in the GUI it will automatically remove the segment references without having to edit the code. Link to comment Share on other sites More sharing options...
Todd Van Valkenburg Posted February 10, 2021 Author Share Posted February 10, 2021 Hi Chuck, Can you elaborate on the reporting options change Or what do I search for in the Technical Library to get more information on this setting We use Info Assist primary for creating new reports rather than App Studio. I did not see this as an option when clicking on options in Info Assist. Thanks Link to comment Share on other sites More sharing options...
Manoj Chaurasia Posted February 10, 2021 Share Posted February 10, 2021 Sure In App Studio you click on the AS icon on the top left and choose the Options which is next to the exit button. Then from there you Click on Reporting and then the Unqualifed Names radio button. image.png25801364 371 KB Unfortunately I do not see that same option for InfoAssist in the IA Properties from the Administration console. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now