Jump to content
The ibi Community has moved to a new platform: Please Sign In and choose Forgot Password to continue

Hello. I have a situation where the fex that creates a perm...


Todd Van Valkenburg

Recommended Posts

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

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

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

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...