View previous topic :: View next topic
|
Author |
Message |
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
Hi,
I have a variable file,I want to know the lenght of each and every record
could any one help me the sort card for this.
input file (variable file) of size 50 to 80-
abced
fdk
fdsfsfdc
output file
data length
abced 5
fdk 3
fdsfsfdc 8
thanks
ajay |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
How about reformating the two byte length in the front of each VB record? |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Code: |
// EXEC PGM=SORT
//SORTIN DD DSN=VARIABLE LENGTH FILE MAX LENGTH=80
//SORTOUT DD DSN=FIXLENGTH FILE LRECL=80..........
//SYSPRINT DD ....
//SYSOUT DD .......
//SYSIN DD *
OPTION COPY
OUTFIL FNAME=OUT,BUILD=(1:5,76,77:1,2)
/* |
In the variable length input file, 1st 4 bytes contain Record descriptor word(RDW). 1st 2 bytes in RDW contains the length of the record. Max data length can be 76 bytes.
So, in the output file, I am moving data field first, followed by length of data.
- Ajay |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ajayvamsi wrote: |
input file (variable file) of size 50 to 80-
output file
Code: |
data length
abced 5
fdk 3
fdsfsfdc 8 |
|
If the length is 50 to 80, why does your example only show the length of the non-blank data? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Ajay,
Your requirement isn't very clear. It looks like you want FB output records with the data from the VB input record and the length of the data (= length of VB record - 4). If so, then you can use the following DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL VTOF,BUILD=(5,76,1,2,BI,SUB,+4,EDIT=(IIIIT))
/*
|
If that's not what you want, then you need to do a better job of explaining what you do want. |
|
Back to top |
|
|
ajayvamsi
New User
Joined: 21 Jul 2005 Posts: 56 Location: Hyderabad
|
|
|
|
thanks for all to ur suggestion I will try this out..
the output file is a fixed length file...
Hi, CICS GUY I was just showing u an example
thanks
ajay |
|
Back to top |
|
|
|