You are here: Available Utilities > L > LBYPROC > Extracting Resources > Example 2

Extracting Resources: Example 2

This example shows you how to extract the last version and revision of all FAP resources from the development library and write them to disk. This script tells the utility to extract FAP resources from the library (MASTER.LBY) and write the resources to the “.\ext\” directory. You specify the target directory using the ALLLIB tag.

Set the VER VALUE tag to (last) to indicate that you only want to extract the latest version of each resource to disk. Also set the REV VALUE tag to (last) to indicate you only want to extract the latest revision of each resource. This combination means that, for any given resource, the utility will only extract the latest revision of the latest version of that resource.

VER VALUE=(last)

REV VALUE=(last)

Since you are asking for only the latest version and revision of each FAP resource, set the LONGFILENAME tag to No. So instead of the resource Q1ADDR.FAP being written to disk with a long name of Q1ADDR_0000100001_19800101.fap, it is written to disk with a name of Q1ADDR.FAP.

If you run the utility with these parameters:

c:\fap\dll\dms1dm>lbyproc /i=deflib\ext2.lsc

You will get this output from the utility:

--- LBYPROC Copyright (C) 1997, 2009 Oracle. All rights reserved.

--- Documaker library script processor

 

Found <1> Library Scripts

 

EXTRACT Successful. Filename<.\ext\Q1ADDR.fap> Name<Q1ADDR> Type<FAP> Ver<00001> Rev<00001> Note<File did not exist yet>

EXTRACT Successful. Filename<.\ext\Q1AFLG.fap> Name<Q1AFLG> Type<FAP> Ver<00001> Rev<00001> Note<File did not exist yet>

EXTRACT Successful. Filename<.\ext\Q1B302.fap> Name<Q1B302> Type<FAP> Ver<00001> Rev<00001> Note<File did not exist yet>

EXTRACT Successful. Filename<.\ext\Q1BA32.fap> Name<Q1BA32> Type<FAP> Ver<00001> Rev<00001> Note<File did not exist yet>

. . .

EXTRACT Successful. Filename<.\ext\Q1VRFL.fap> Name<Q1VRFL> Type<FAP> Ver<00001> Rev<00001> Note<File did not exist yet>

 

--- LBYPROC Complete ---

Here are the contents of the ext2.lsc file, which contains the Extract script:

<LBYSCRIPT>
<EXTRACT>
<LIBRARY VALUE="DEFLIB\MASTER.LBY"/>
<FILENAME VALUE=""/>
<NAME VALUE=""/>
<TYPE VALUE="FAP"/>
<DESC VALUE=""/>
<VERSION VALUE="(last)"/>
<REVISON VALUE="(last)"/>
<USERID VALUE=""/>
<EFFDATE VALUE=""/>
<MODE VALUE=""/>
<STATUS VALUE=""/>
<CLASS VALUE=""/>
<PROJECT VALUE=""/>
<ALLLIB VALUE=".\ext\"/>
<BDFLIB VALUE=""/>
<GRPLIB VALUE=""/>
<FORLIB VALUE=""/>
<FAPLIB VALUE=""/>
<DDTLIB VALUE=""/>
<LOGLIB VALUE=""/>
<DALLIB VALUE=""/>
<DEFLIB VALUE=""/>
<LONGFILENAME VALUE="No"/>
</EXTRACT>
</LBYSCRIPT>