Joined: 09 Aug 2008 Posts: 1631 Location: Mumbai, India
Posted: Fri Dec 12, 2008 11:24 am Post subject: Frequently used commands in FileAid.
I have listed few commands, if anybody know any more commands with examples- please add on
File-Aid is a versatile utility that is basically used for re-formatting data while copying from another data set. Apart from several usage of this utility like copy data sets, concatenate datasets etc., FILEAID can also be used to check whether a file is empty or not. Below is the general structure of File-Aid batch processing JCL.
Here DD01 is copied to DD01O and DD02 is copied to DD02O
4. Conditional copy
$$DD01 COPY IF=(776,GE,P'2'),IF=(1311,EQ,C'1')
In this example, copy input file data only if 776th digit is greater than or equal to 2 in packed digit format or if 1131st character is equal to '1'.
5. Multiple if entries are coded within a single IF parameter. It is a format to code logical OR conditions. If input record contains characters 173 or 326 at the location 14 then only they are copied to the output file.
This is a combination of COPY, IF, OUT and PRINT. It copies the first 5 records that contain the string '423' at location 8 and prints the first 2 selected records. Here the printed records will go to DD name specified in SYSLIST.
$$DD01 COPY MOVE=(1,10C'ABC')
Combination of COPY and MOVE. It copies ten repetition of the string to the output location 1 through 30.
$$DD01 COPY OUT=60
Combination of COPY and OUT. It copies the first 60 records to the output data set.
$$DD01 COPY PRINT=15
Combination of COPY and PRINT. It copies the input dataset while printing the first 15 records. _________________ Regards,
In this example, if character '7' or '8' is found in column 1 of input file and characters '8000' is found in column 6 of input file then it is replaced by characters '8240' in output file from column 6 onwards.
$$DD01 COPY RA=(1,60,C'ABCD',2C'XY')
Combination of COPY and REPLALL. It copies all input records while REPLALL parameter scans locations from 1 to 60 of each record and replaces all occurrences of the string 'ABCD' with 'XYXY'.
Combination of COPY, IF, ORIF and REPLACE. It copies the records that have characters '275' at location 8 or 'SU' at location 60. If location 60 has characters 'SU' then it overlays the data at location 1 with 'ABC'.
Combination of UPDATE, IN and REPLACE. It makes permanent changes to an existing data set. The first update places the pointer at a particular record and the second UPDATE replaces the data. _________________ Regards,
A combination of COPY, IF and ACCUM. the TALLY function binds the two ACCUM functions. It checks whether the first two IF conditions are satisfied. If so then the totals of the field from 50 to 54 are generated and labeled under the heading 'TOTALS'. For the second IF the field at location 15 is accumulated and labeled the heading as 'SUBTOTAL'.
It uses the back function which provides the backward processing of the records. SPACEBACK will do the backward processing of the records and stops at the record which satisfies the particular condition provided in the STOP parameter. The DUMPBACK will also do the backward processing and print such 6 records.
Here step checks 28th characters onwards in input file in characters mode. If field contains values 'BC4', 'BC9', 'BC5' or 'DFC' then output 1 is written else output 2 is written.
$$DD01 USER WRITE=FILE02,
Combination of USER, WRITE, IF and MOVE. The first WRITE parameter writes all the input records and if the selection criteria matches then it performs the MOVE and then repeats the records with the changed value in the output data set. _________________ Regards,
I have one more control card
$$DD02 US MS=ALL,OUT=0,
from all the members of DD02 dataset.
if the first character is equal to 'M'
then 2 characters are moved from 3rd position to 2 postions and placed in the
2nd position of the output file and output file dd name is JOBPREFX.
Conversion of PD to ZD/ZD to PD can be achieved by using the option EDIT in the FILE-AID
The EDIT parameter replaces character, packed, or hexadecimal data in a record with character, packed, or hexadecimal data of a different length. When EDIT is executed, File-AID shifts the remaining data to adjust for the change. The EDIT parameter only changes the first occurrence of matched compare-data in a record. To change more than one occurrence of compare-data, use multiple EDIT parameters. To change all Occurrences, use the EDITALL parameter.
The data 123 in the form of PD at location 1 of length 3 bytes is converted to Zoned numeric value of 123.
I have been trying to figure out how to drop, remove, or delete a particular line within a JCL member while adding some lines. Can someone please help!!
I am successful adding some lines, but not successful deleting them. I using the following to add some lines and they work, I edited each line in a previous step with random word(s), so each line command below is not recongized as part of a previous JCL statement. This is so i can add following line commands. In the next step after this step below, I replaced the random word(s) to space " " that was done in the previous step (done before this step below) so now the JCL statements are now correct :
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum