AKSHAY 10000 00002 Take the counts from something which is already reading the data, and then you have something really simple, and efficient. Example: Reformat different records in different ways by specifying how build, overlay, find/replace, or group operation items are applied to records that meet given criteria. To learn more, see our tips on writing great answers. //SYSIN DD * Why did Ukraine abstain from the UNHRC vote on China? INREC:Specifies how records are reformatted before they are sorted, copied, or merged. Making statements based on opinion; back them up with references or personal experience. Statement SORT FIELDS=COPY is coded to specify that all records should be copied from input file to output file. However, while writing to output file, only fields EMP-NAME (I/P file POSITION 6-25) and EMP-SALARY (I/P file POSITION 46-50) should be written to it, Requirement: To copy all records and while writing output records, all records should be appended with sequence number, INSERTING SPACE, ZEROES or CHARACTER String to your output, Requirement 1: Copy input file to output file as it is just add two spaces after writing first field of length (1-5). Inserting Zeros, Spaces and Character strings to your output You can insert blanks before, between, or after fields. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. OUTREC FIELDS=(1,5,ZD,TO=FS,LENGTH=6,..)converts the first five bytes ZD from input file to FS of 6 bytes and writes it to output. So the following control statement will include only those records with a Cyyyymmdd date in positions 10-17 equal to todays date: Of course, you can use the other comparison operators (NE, GT, GE, LT, LE) as well as EQ. /*, ----+----1----+----2----+----3 FIXLEN=5 tells DFSORT that the %01 parsed field is 5 bytes long. rev2023.3.3.43278. Is it possible to rotate a window 90 degrees if it has the same length and width? By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Build parameter can be used in OUTFIL statement also. To calculate percentage (Number of records in FILE1/Number of records in FILE2)*100 using DFSORT in Mainframe. // DCB=(RECFM=FB,LRECL=40,BLKSIZE=0), SORT statement. Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2. Follow Up: struct sockaddr storage initialization by network format-string. Convert the first five bytes ZD to FS in the input file. So either of the following pairs of control statements will sort your records on input positions 1-6 and reformat them with todays date in the form Cyyyy-mm-dd in output positions 1-10, and input positions 1-6 in output positions 11-16. JCL does not have BUILD/OUTREC statements. OUTREC FIELDS=(..,6,73)copies the input file data from 6th byte to the output file from 8th byte onwards as it is. DFSORT extends the reformatted input records from 80 bytes to 83 bytes to accommodate the identifier byte added in position 81 and the sequence number added in positions 82-83. Asking for help, clarification, or responding to other answers. NOMATCH=(11,3), - BUILD exists on INREC, OUTREC and OUTFIL, separately and as part of an IFTHEN. Brackets affect the "precedence" of numeric operators in a normal way (consult the manual to be familiar with the precedence rules). Find centralized, trusted content and collaborate around the technologies you use most. Explnation: Above statement will convert data field at position (1-10) of input file to Hexa-decimal representation and write it to output file. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. Each day we want only the records for that day to be copied into the output file. C'FRI',C'FRIDAY', - Example: PARSE can be used for many different types of variable fields including delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings, and so on. OVERLAY says "update the information in the current record with these data-manipulations (BUILD always creates a new copy of the current record). Would the magnetic fields of double-planets clash? You can use nZ to specify n binary zeros. Do you have an example of the input and expected output? TOT calculates the number of records in the input file. The output file will contain the unique employee numbers sorted in ascending order. 40 RAMESH 34000 03 20120410 50 Kishore 50000 02 20120408. Add two days, two years to the date in the input file. WIDTH can only be specified If your LRECL does not need to be set to a particular INREC statement. In the above example, employee number is in the field position 1,15. Otherwise, you can let ICETOOL calculate and set the INREC FIELDS=(7:2,5,20:10,3) - Here we have two formattings, 7:2,5 - data at 2nd position of input file with length 5 copied to 7th position of output file, 20:10,3 - data at 10th position of input file with length 3 copied to 20th position of output file. Syncsort Manual: Click Here. As a mainframe resource, if you have command on DFSORT you will get many job opportunities. You can delete, rearrange and insert fields and constants. Do new devs get fired if they can't solve a certain bug? The option STOPAFT will stop reading the input file after 10th record and terminates the program. OUTREC: Specifies how records are reformatted after they are sorted, copied, ormerged. Formatting output file after an INCLUDE condition in JCL, How Intuit democratizes AI development across teams through reusability. OUTREC FIELDS=(1,80,SQZ=(.., MID=C,)) the data which had spaces in between separated by ,. To subscribe to this RSS feed, copy and paste this URL into your RSS reader. Inrecworks just like if you wantto replace a part of your input record to your data. IFTHEN statements allow you to reformat different records in different ways by specifying how build or overlay items are to be applied to records that meet given criteria. Example: Reformat each record by doing various types of find and replace operations. . Staging Ground Beta 1 Recap, and Reviewers needed for Beta 2, How to change the properties of a ps or an pds, Passing symbol value using DFSORT to file, mainframe - generate a report with sum of particular fields. OUTREC IFTHEN=(WHEN=INIT,BUILD=(1:1,80)),..) Copies the 80 bytes data from input file to output as it is. If clause 3 is not satisfied, its build items are not applied and processing continues. If you want to replace or remove data anywhere in records, the FINDREP parameter of the OUTREC statement needs to use instead. This sort card will insert spaces in the first 20 bytes, then the fields 1 to 5 from the input file are moved to 21 thru 25, 26 thru 36 will have blanks and then input file fields from position 6 to 10 is moved to output file positions 37 to 41. FINDREP indicates doing a find and replace operation. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. INREC adds, deletes, or reformats fields before the records are sorted or merged. My code is GPL licensed, can I issue a license to have my code be distributed in a specific MIT licensed project? To include a single apostrophe in the string, you must specify it as two single apostrophes example, to include the word Toms you need to specify CToms. SECTIONS is used to generate a report header for each transaction. To insert a character string to your output includeC your stringas part of your OUTREC , you can include anyEBCDIC character between single quotes. 21,10) Can Martian regolith be easily melted with microwaves? 99999JOHN ADMIN 28000, //SORTSTEP EXEC PGM=SORT rev2023.3.3.43278. Tell them what you want to do, and they probably already have something you can use to do it with (when discussing this, bear in mind that these are technically data sets, not files). If you know that your count requires less than 15 digits, you can use OUTREC FIELDS=(1,80,SQZ=(SHIFT=LEFT,..)) Squeezes the data in 1-80 bytes to the left. IBMMainframes.com is not an official and/or affiliated with IBM. Inputfile for SORT JCL 10 suresh 20000 01 20120203 34 20 NARENDRA 40000 06 20120925 AB 30 jacob A 25000 07 20111018 1A 40 RAMESH 34000 03 20120610 2C 50 Kishore 50000 02 . OUTFIL 03 gets all the not 0000s which are not 'Y'. The DATE1 operand corresponds to a Cyyyymmdd constant for todays date. Is there any other way of achieving the same in JCL? . M11 is a built-in edit-mask. Thus total record length of output file is 40. And setting Return Code if it crossing a threshold (90%). Display Filter View Print Options Help, WER268A SORT STATEMENT : SYNTAX ERROR, ****** ***************************** Top of Data ******************************. You can use INCLUDE and OMIT to select records using a variety of formats for past and future dates like Cyyyymmdd, Cyyyy/mm/dd, +yyyymmdd, Cyyyyddd, Cyyyy/ddd, +yyyyddd, Cyymmdd and so on. Example: PARSE can be used for many different types of variable fields including delimited fields, comma separated values (CSV), tab separated values, blank separated values, keyword separated fields, null-terminated strings, and so on. You can read my previous installment if you miss it. length. Browse other questions tagged, Where developers & technologists share private knowledge with coworkers, Reach developers & technologists worldwide. This is from the DFSORT Application Programming Guide: WRITE(countdd) Specifies the ddname of the count data set to be Example: INREC BUILD= (1,20,C'ABC',26:5C'*', 15,3,PD,EDIT= (TTT.TT),21,30,80:X) OVERLAY: Reformat each record by specifying just the items that overlay specific columns. Note, the physical order in which these are specified in the JCL does not affect the order they are processed in. The 0, 1 or 9 identifier byte added in position 81 allows us to sort the header records (0) first, followed by the detail records (1), and then the trailer records (9). Here is the OUTREC SORT card. DIGITS can only be specified if SUM FIELDS=NONE removes duplicates on fields specified in SORT FIELDS. Try changing OUTREC to OUTFIL. OUTREC FIELDS=(1,29,JFY=(.., LEAD=C'<,TRAIL=C>),..) adds the C< as a lead and C> as a trail. For the input record: NEW YORK,ABC NEW JERSEY,XYZ,NEW YORK, The output record would contain: NY,ABC NJ,XYZ,NY. For SORT FIELDS=COPY It is for copy records to output file. Read the answer please. Default for PARSE: None; must be specified. Reformat each record by specifying all of its items one by one. Does the below answer suffice? OUTREC FIELDS=(1:1,30,36:SEQNUM,5,ZD) The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. /*, ----+----1----+----2----+----3 For example: OUTREC BUILD=(DATE3,TIME1,1,6) would produce a character timestamp in output positions 1-12 of the form: yyyydddhhmmss, More easily, you could use DATE4 to produce a timestamp of the form: yyyy-mm-dd-hh.mm.ss or DATE5 to produce a timestamp with microseconds of the form: yyyy-mm-dd-hh.mm.ss.nnnnnn. produced by ICETOOL for this operation. I added DIGITS(6) in step001 and modified below OUTFIL FNAMES=SETRC,NULLOFL=RC4,INCLUDE=(23,6,CH,GT,C'090.00'). Learn more. CSM, CSPO, CSD, CSP, A-CSPO, A-CSM are registered trademarks of Scrum Alliance. 4. The sequence number starts at 5 and is incremented by 5 each time. You can assign up to 1000 parsed fields (%0-%999) to the variable fields you want to extract. Maybe I have it wrong but I was trying to have the first include exclude what would get selected in the second an subsequent includes. INREC FIELDS=(1,20,X,25,6,X,) - Reformat the input file of length 1 to 30 bytes(1 to 20 bytes plus 25 to 6 bytes). For date values in the form Cyyyy/mm/dd, you could use the DATE1(/) constant; For date values in the form Cyyyy-mm, you could use the DATE2(-) constant; For date values in the form Pyyyyddd, you could use the DATE3P constant; For date values in the form Zyymmdd (2-digit year date), you could use the YDATE1 constant. My approach has to be execute a statement check the results then add the next statement. // UNIT=TEST,SPACE=(CYL,(50,10),RLSE) // UNIT=TEST,SPACE=(CYL,(50,10),RLSE) If clause 2 is satisfied, its build items are applied and processing continues. If your logic is wrong, that'd be the problem. LRECL to the calculated record length. If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community! . DFSORTis a very good concept for record manipulation. . Build give complete control over output file format. You can use X or 1X to specify a single blank. The finaloutput will be the same. Explnation: Above statement will convert data field at position (1-20) of input file to its uppercase form and write it to output file. C'THU',C'THURSDAY', - Does a summoned creature play immediately after being summoned by a ready action? Statement SORT FIELDS=COPY is used here to indicate that all records will be copied from input file to output file. Syntax for using FIELDS parameter in its simplest form:- OUTREC [FIELDS|BUILD] = ( C:P,M,.) Note that if all of the fields in your records have fixed positions and lengths, you don't need to use PARSE. count record length does not exceed a specific maximum (for example, length is 25) should be copied at position 1 in output file followed by the field at position (46 to 50 i.es length is 5) should be copied at position 26 of output file. If 6th position is SPACES, then text "EMPTY" is appended to input record. Connect and share knowledge within a single location that is structured and easy to search. The sequence number added in positions 82-83 will allow us to keep only the first header record and the first trailer record. As you coded later, SFF should work depending on your release of Syncsort. CHANGE=(10, - If clause 1 is not satisfied, its overlay item is not applied and processing continues. WHEN=NONE clauses are processed after any of the other IFTHEN clauses. Align the data in the first 29 bytes to LEFT and replace () with <>. Overwrite input record content. In addition to this it will replace 3 letter day-of-week name at position 11 in input file with its full name at position 11. Note that if all of the fields in your records have fixed positions and lengths, you dont need to use PARSE. The output file will contain the unique employee numbers sorted in ascending order. . It confuses people trying to give you an answer. . Lots of errors here. Lets assume N is 30 days. Back to top If clause 1 is satisfied, its overlay item is applied and processing stops. OUTREC keeps only positions 1-80 for the OUTFIL output records, thus removing the identifier byte and sequence number we added in positions 81-83 with the INREC statement (we do not want these temporary fields in the OUTFIL output records). To insert 5 blanks, write 5X between the two fields. Note that if all of the fields in your records have fixed positions and lengths, you don't need to use PARSE. Following records will be selected from the input file. We can even add spaces/zeroes/any character into the output record based on the requirement. //SORTOUT DD DSN=DEPT.EMPL.DATA.OUTPUT1, Overlay lets you change specific existing columns without affecting the entire record. SORT FIELDS=COPY Example: Reformat different records in different ways by specifying how build, overlay, find/replace, or group operation items are applied to records that meet given criteria. The sort utility you use does have them. Default for PARSE: None; must be specified. Alternatively, something has already previously read or written those files. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. I don't know what "Code" tags are. steve MONDAY 20000 If the records are variable-length, the RDW of the record would be reduced to indicate the new length after the shorter literals are substituted. default of 15 digits. count data set. Using SORT DATE Functions you can dynamically insert the date, like yyyy-mm-dd or any format instead of a constant date like 2021-01-01. by specifying an appropriately higher d value for DIGITS(d). example, 80), or if you want to ensure that the count record length does not exceed a specific maximum (for example, 20 bytes). than or equal to n, ICETOOL sets the record length and LRECL to n. All IFTHEN parameters have been processed. I have used OPTION COPY for clarity. Making statements based on opinion; back them up with references or personal experience. Presumably your files are quite large? IFTHEN - Give us the more flexibility in handling different types of records, in . Write unique records to output. 20 bytes). The number in stock and number sold fields are binary values which would actually be unreadable if you printed or displayed the output records shown in Table 2. SORT FIELDS=(1,3,ZD,A) - Once the above two tasks done, the file will sorted and the same writes to output after sorting. Steps to Create the OUTREC Statement for Reformatting Records. SORT FIELDS=COPY Using Kolmogorov complexity to measure difficulty of problems? To subscribe to this RSS feed, copy and paste this URL into your RSS reader. If the data is going into that column automatically (which it is), then using the columns only creates work, introduces a new possibility of error, and makes the Sort Control Cards more difficult to maintain. appropriate record length and LRECL by not specifying WIDTH(n). If clause 2 is not satisfied, its build items are not applied and processing continues. To covert the input data from lower case to upper case. /*, ----+----1----+----2----+----3----+----4 If you use PGM=SORT, for example, that's a utility. // DISP=(,CATLG,DELETE), How to use Slater Type Orbitals as a basis functions in matrix method correctly? BUILD gives you complete control over the items you want in your reformatted OUTREC records and the order in which they appear. Site design / logo 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA. vijay SUNDAY 30000. The same functionality can be achieved using ICETOOL also. 88888JOHN PURCHASING 08000 Use a WHEN=ANY clause after multiple WHEN=(logexp) clauses to apply additional build or overlay items to your input records if they satisfied the criteria for any of the preceding WHEN=(logexp) clauses. Please do not use JCL as a general term for utilities. Overlay lets you change specific existing columns without affecting the entire record. If you use DIGITS(d) and the count overflows the number of digits Use WIDTH(n) if your count record length and LRECL must be set to a instead. Build gives you complete control over the items you want in your reformatted OUTREC records and the order in which they appear. Since the sequence number is not specified for the detail records, it will be blank. Data at position 11 in input file will be compared with CHANGE list. All of the data which passes the INCLUDE will be on one of the three OUTFILs, and only one. Please note that file in SYSUT2 takes the same DCB as that of the SYSUT1 in the above example. Normally it will be given with Join Keys or during the sort. Now its working fine. This statement supports a wide variety ofparsing, editing, andreformatting tasks. . Example: Reformat each record by doing various types of find and replace operations. EDIT=(TTT.TT) is a used-defined edit mask, in this case inserting a decimal point, truncating the otherwise existing left-most digit, and having significant leading zeros when necessary. . It should be: Code: INREC FIELDS= (.) Output file for SORT JCL Assume the current date is 4-Apr-2012. How to use Slater Type Orbitals as a basis functions in matrix method correctly? //SYSIN DD * When is the condition Overlay is the actualvalue to be replaced similarly. //SORTIN DD DSN=DEPT.EMPL.DATA.OUTPUT1,DISP=SHR OUTREC in SORT JCL - Example 1 If you want to add sequence number to the output data after sorting input data. The below is what I think you are trying to do. OUTREC FIELDS=(..,30,30) Copies the input file data from 30th byte of length 30 copies to output as it is. Include 1 excludes what Include 2 and 3 will select, likewise Include 2 excludes what 1 and 3 will select. OUTREC FIELDS=(..,40,8,ZD,EDIT=(SII,III,IIT),SIGNS=(,-))converts the 8 digit ZD to M12(SII,III,IIT) and displays sign only for negative values. Previous //SYSPRINT DD SYSOUT=* Why do we calculate the second half of frequencies in DFT? You can delete, rearrange and insert fields and constants. Syntax for using FIELDS parameter in its simplest form:-, C ==> indicates the position in output field, P ==> indicates the position of input field, Requirement: To copy all the records from input file to output file. Input file has one or more records for same employee number. In addition I want only part of the record in the output file given by the below 3 BUILD's. You can delete, rearrange and insert fields and constants. ICETOOL pads the count record on the right with blanks to the record Relation between transaction data and transaction id. You can mix p,m fields (fixed fields), and %nn fields (parsed fields) in BUILD and OVERLAY. Since hexadecimal representation occupies two digits for each character, here we will need output file with record length of 20. Thus total record length of output file is 30. You can prevent the overflow The nature of simulating nature: A Q&A with IBM Quantum researcher Dr. Jamie We've added a "Necessary cookies only" option to the cookie consent popup. ICETOOL's COUNT operator how long you wanted the output data to be, so Following records will be selected from the input file. . FIELDS is "old" and available for backwards-compatibility. and what would happen then? //SORTIN DD DSN=DEPT.EMPL.DATA.OUTPUT1,DISP=SHR Requirement: To convert field at position 1-20 of input file to Upper case characters. OUTREC FIELDS=(1,54,..)copies the first 54 bytes from the input file to output as it is. What is the purpose of non-series Shimano components? This will make the whole process inefficient. Use one or more WHEN=NONE clauses to apply build or overlay items to your input records that did not meet the criteria for any of the WHEN=(logexp) clauses. For yyyymm + 3 months, you could use DATE2+3; For Pyyyyddd 150 days, you could use DATE3P-150; For Zmmddyy + 7 days, you could use YDATE1+7. It is used to reformat each record by specifying all of its items one by one. If you input file record is 2015/04/0415:30 theoutput will be Run Date:2015/04/04|Run Time:13:30. But if any of the fields in your records have variable positions or lengths, you can use PARSE to treat them as fixed parsed fields in BUILD or OVERLAY. . Not the answer you're looking for? Magic. The%parsed field is used to skip the variable field without extracting anything for it. if WRITE(countdd) is specified. . Build gives you complete control over the items you want in your reformatted OUTREC records and the order in which they appear. 1,20 - data at 1st position of input file with length 20 copied to 1st position(if you don't specific position, it will start from 1st position) of output file. a lower number of digits (d) instead by specifying DIGITS(d). Remove the () from data in first 29 bytes and remove spaces between the data and separate the data with ,. length = 30) should be copied at position 1 in output file followed by the sequence number of 5 digit in Zoned Decimal format should be written at position 36 of output file. C'WED',C'WEDNESDAY', - OUTFIL 01, moved to make it easier to follow, gets all the records which are not selected on another OUTFIL (by using SAVE). is the protected brand of Scrum.org. There are multiple Date Functions by which you can reformat input dates. Build gives you complete control over the items you want in your reformatted OUTREC records and the order in which they appear. One way, if on-the-dot accuracy is not required, is to talk to the technical staff who manage your storage. How do I align things in the following tabular environment? The question is unclear, so this is just a guess at what was wanted. Likewise, the sequence number will be 1 for the first trailer record, 2 for the second trailer record and 3 for the third trailer record. . Can carbocations exist in a nonpolar solvent? confused.. Can you please explain how this would work over the syntax i have tried. OVERLAY - Replace the selected columns without impacting other columns. After step 4) the sign is missing. is the protected brand of Scrum.org. A countdd DD statement must be Agree OK, perhaps 7.3m is not so large, but, when you have your "solution", the next person along is going to do it with 100,000 records, the next with 1,000,000 records. Example: OUTREC FINDREP=(IN=Csmall,OUT=CSMALL) finds the text small in the entire input file with the SMALL and writes to the output. Thanks for contributing an answer to Stack Overflow! 2) Convert ZD to PD; example of ZD formats are '000000000002.459000-' and '0000000000000005.42-'. Under the OUTREC parameter of the OUTFIL control statement, see [n]/ on page 2.91 for a complete description of the / sub parameter. Lets say we have a file with a date in a particular position and we want to select only records where the date is greater than the current or a particular date + or N number of days and it can be 0 to 9999. You could insert the current time as well as the current date in your records to produce a timestamp. Obviously I have a lot of catching up to do! The first 10 records need to be written to output file. Please do not use JCL as a general term for utilities. ENDBEFR=C tells DFSORT to stop extracting data at the byte before the next comma (the comma after the first variable field). How to get the unload result in Packed decimal format if the table column is in INTEGER formmat in the DB2 table? is the protected brand of Scrum.org. 2X in OUTREC FILEDS statement indicates two spaces and thus record length of output file will be 12. Example MON will be replaced by MONDAY. Did you read the documentation of COUNT (No, is the answer, so do so)? How can I use it? INREC is useful in case of the large input files. For your second question, yes it can be done in one step, and greatly simplified. If clause 6 is satisfied, its build items are applied and processing stops. Statement SORT FIELDS=COPY, is used here to indicate that all records should be copied from input file to output file. OUTREC statement used above will copy first 10 bytes from input file & convert all letters to lowercase letters. This enables all the records in a group to be sorted together. CHANGE=(10 indicates that replacing string will occupy 10 letter positions. OUTREC FIELDS=(..,30,4,CHANGE=(11,Cmath,Cmathematics),..) The math text starting from 30th byte of length 4 in the input file should replace with mathematics of length 11 while writing it to output file. You can assign up to 1000 parsed fields (%0-%999) to the variable fields you want to extract. You can assign up to 1000 parsed fields (%0-%999) to the variable fields you want to extract. Time constants can also be produced in a variety of other characters, zoned decimal and packed decimal formats as well such as Chh:mm, Zhhmmssxx and Phhmmss. Using BUILD on INREC, OUTREC and OUTFIL, and not using OUTFIL OUTREC= is simply for clarity. You can use nX to specify n blanks.To insert 10 blanks, write 10X before the first field. . //SYSPRINT DD SYSOUT=* OUTREC FIELDS=(1,48,..) copies first 48 bytes input file data as it is to output. AKSHAY TUE 10000 Note, the physical order in which these are specified in the JCL does not affect the order they are processed in. But if any of the fields in your records have variable positions or lengths, you can use PARSE to treat them as fixed parsed fields in BUILD or OVERLAY. IEBGENER copies the file in SYSUT1 to file in SYSUT2. IFTHEN=(WHEN=(30,5,CH,EQ,Csmall),OVERLAY=(45:C***)) overlays the marks of the student with *** who are belong to small. akshay TUESDAY 10000 If clause 3 is satisfied, its build items are applied and processing continues. The first IFTHEN WHEN=(logexp) clause identifies and operates on header records (HDR in positions 1-3); OVERLAY puts todays date in the form ddd/yyyy in positions 6-13, adds a 0 in position 81, adds a ZD sequence number in positions 82-83 and does not affect the rest of the record. However while writing to output file, two spaces will be added between fields at position 1-5 and 6-10. IFTHEN clauses let you use sophisticated conditional logic to choose how different record types are reformatted. FIELDS specifies an ascending 1-byte character control field at position 81 (the identifier byte added by INREC), and an ascending 5-byte character control field starting at position 8 (the key for the detail records).