Posted: Mon Jul 09, 2007 9:36 am Post subject: OUTREC problem for vb file
Hi,
Input file:
recfm=vb,lrecl=50
records:
Code:
----+----1----+----2----+----3----+----4----+-
***************************** Top of Data ****
PPPPDDDDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDD---XYZ
PPPPDDDDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDD---XYZ
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
where the 3 record length is 37.
output file:
recfm=vb,lrecl=52
Kolusu's post will work but it will give you records that are all 52 bytes long. For those records that do not contain the entire last field, the values in the missing parts of the record will be filled with spaces. If you want to retain the variable length of your records I think the following INREC statement should do that for you:
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 09, 2007 10:49 am Post subject:
amargulies,
Shouldn't IFTHEN Check based on the shortest record? Probably should run histogrm program and find out the shortest lrecl and use that info in the IFTHEN stmt. What happens if there is another short record whose length is less than 32?
Another option is to use another step to copy with VLTRIM and retain the variable length
You are correct. If the input data can have records that are shorter than what the user stated it may be necessary to have more IFTHEN statements. My goal was to demonstrate what was possible with the sort not necessarily create the users application for them. I think they should be able to extend the example to suit their needs. If they have questions or problems I will be happy to assist.
Thank you for mentioning HISTOGRM. This is a utility program distributed with SyncSort. It performs a basic analysis of data sets that are RECFM=V. One of the pieces of information that is given is the shortest record length found in the data set. HISTOGRM is documented in Chapter 14 of the Programmer's Guide. If some one needs this manual just contact me offline and I will get you one. _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Jul 10, 2007 1:30 pm Post subject:
For the record, here's a DFSORT/ICETOOL job that will display statistics for VB records:
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file (VB)
//RPT DD SYSOUT=*
//TOOLIN DD *
* List minimum, maximum, total and average record length in TOOLMSG.
STATS FROM(IN) ON(VLEN)
* Show the number of records with each length in RPT.
OCCUR FROM(IN) LIST(RPT) BLANK -
HEADER('Length') ON(VLEN) -
HEADER('Count') ON(VALCNT)
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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