Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

variable file:To find the lenght of each record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ajayvamsi
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Tue Feb 26, 2008 2:47 pm    Post subject: variable file:To find the lenght of each record
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 26, 2008 5:28 pm    Post subject:
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: 205
Location: Bangalore

PostPosted: Tue Feb 26, 2008 7:03 pm    Post subject: Reply to: variable file:To find the lenght of each record
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: 2150
Location: At my coffee table

PostPosted: Tue Feb 26, 2008 7:18 pm    Post subject: Re: variable file:To find the lenght of each record
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 Moderator


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

PostPosted: Tue Feb 26, 2008 9:56 pm    Post subject:
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
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Wed Feb 27, 2008 11:03 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us