IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

variable file:To find the lenght of each record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ajayvamsi

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Tue Feb 26, 2008 2:47 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 26, 2008 5:28 pm
Reply with quote

How about reformating the two byte length in the front of each VB record?
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 206
Location: Bangalore

PostPosted: Tue Feb 26, 2008 7:03 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Feb 26, 2008 7:18 pm
Reply with quote

ajayvamsi wrote:
input file (variable file) of size 50 to 80-

Code:
abced
fdk
fdsfsfdc

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 26, 2008 9:56 pm
Reply with quote

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
View user's profile Send private message
ajayvamsi

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Wed Feb 27, 2008 11:03 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top