MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OUTREC problem for vb file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
yrcreddy
Beginner


Joined: 28 Dec 2005
Posts: 27
Topics: 12

PostPosted: Mon Jul 09, 2007 9:36 am    Post subject: OUTREC problem for vb file Reply with quote

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
Code:

SYSIN card
//SYSIN    DD *
 SORT FIELDS=COPY
 OUTREC FIELDS=(1,4,C'0',5,12,C'0',17,34)
/*

I am trying to reformate the variable length records file by using the above SYSIN card.but i am getting the following Syncsort error message:
Code:

SORTIN   : RECFM=VB   ; LRECL=    50; BLKSIZE=    54
OUTREC RECORD LENGTH =    52
SORTOUT  : RECFM=VB   ; LRECL=    52; BLKSIZE= 27998
OUTREC - SHORT RECORD

if i use the following input data for the above SYSIN Card.i am not getting any error
Code:

----+----1----+----2----+----3----+----4----+-
PPPPDDDDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDD---XYZ
PPPPDDDDDPPPPDDDDDDDDDDDDDDDDDDDDDDDDDDD---XYZ
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ

where the 3 record length is 46.

can u please let me know why the shorter length records are not reformating.
_________________
Thanks,
Ramachandra Reddy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jul 09, 2007 9:58 am    Post subject: Reply with quote

yrcreddy,

Try this control cards. You need to use the parm VLFILL to pad the missing fields.
Code:

//SYSIN     DD *                   
  SORT FIELDS=COPY                 
  OUTFIL VLFILL=C' ',             
  OUTREC=(1,4,C'0',5,12,C'0',17,34)
/*                                 


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
videlord
Beginner


Joined: 09 Dec 2004
Posts: 147
Topics: 19

PostPosted: Mon Jul 09, 2007 9:59 am    Post subject: Reply with quote

for VB records, the first 4 byts are not counted
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jul 09, 2007 10:00 am    Post subject: Reply with quote

videlord wrote:
for VB records, the first 4 byts are not counted


hmm Not true. why wouldn't you count the RDW?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Mon Jul 09, 2007 10:28 am    Post subject: Reply with quote

yrcreddy/kolusu,

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:


Code:
     SORT FIELDS=COPY   
     INREC IFTHEN=(WHEN=(1,2,BI,GE,X'0032'),           
                BUILD=(1,4,C'0',5,12,C'0',17,34)),   
           IFTHEN=(WHEN=(1,2,BI,LT,X'0032'),           
                BUILD=(1,4,C'0',5,12,C'0',17))

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jul 09, 2007 10:49 am    Post subject: Reply with quote

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

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Tue Jul 10, 2007 12:41 pm    Post subject: Reply with quote

kolusu,

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
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jul 10, 2007 1:30 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group