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
 

 

How to find record length of a Variable length record?

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

New User


Joined: 26 Dec 2007
Posts: 18
Location: Chennai, India

PostPosted: Wed Nov 26, 2008 1:42 pm    Post subject: How to find record length of a Variable length record?
Reply with quote

Hi,

I was just trying out "/" operator. I faced one situation.
I was using VB file both as input and output.

My check in the job goes like this:
Input file record: Maxlength 16
Output file record: Maxlength 4
What I wanted to do is to split the input record if it exceeds 4 and put the rest in the next line.
For example:

Input records:

ABCD
EFGHIJKLM
NOP
QRST

My expected output records are:

ABCD
EFGH
IJKL
M
NOP
QRST
I have used the following,
Code:
OPTION COPY                                                   
OUTFIL FNAMES=FILE2,BUILD=(1,4,5,4,/,1,4,5,4,/,1,4,5,4,/,1,4,5,4),VLFILL=C' '


With out VLFILL job comes back with maxcc 16 thats why I had to use it.
Now the problem is if the length is less then in the output record I am getting some blank lines.
With the same input which I gave above, my actual output is coming as

ABCD
EFGH
IJKL
M
NOP



QRST
Is it possible to change the job so that these blank lines donot come? If there is some data to put in a new line then only it should enter a line.
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: Wed Nov 26, 2008 10:09 pm    Post subject:
Reply with quote

Those control statements would have given you the first 4 bytes over and over. I suspect you really used these control statements which would give you what you said you got:

Code:

  OPTION COPY                                                     
  OUTFIL FNAMES=FILE2,                                           
   BUILD=(1,4,5,4,/,1,4,9,4,/,1,4,13,4,/,1,4,17,4),VLFILL=C' '   


But that's not the right way to do what you asked for. Here's a DFSORT job you can use to do it:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//FILE2 DD DSN=...  output file (VB)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=FILE2,
    IFTHEN=(WHEN=(1,2,BI,LE,8),
      BUILD=(1,4,5)),
    IFTHEN=(WHEN=(1,2,BI,LE,12),
      BUILD=(1,4,5,4,/,1,4,9)),
    IFTHEN=(WHEN=(1,2,BI,LE,16),
      BUILD=(1,4,5,4,/,1,4,9,4,/,1,4,13)),
    IFTHEN=(WHEN=NONE,
      BUILD=(1,4,5,4,/,1,4,9,4,/,1,4,13,4,/,1,4,17))
/*
Back to top
View user's profile Send private message
sourav_dasgupta

New User


Joined: 26 Dec 2007
Posts: 18
Location: Chennai, India

PostPosted: Thu Nov 27, 2008 8:59 am    Post subject: Sorry Frank!
Reply with quote

Yes Frank,
While writing the build it was a copy/paste issue from my side. Sincerely sorry for that.
The solution looks nice to me. Reading the length and depending on that If-When... Thanks a lot for this.
I will try the above out and let you know.
Back to top
View user's profile Send private message
sourav_dasgupta

New User


Joined: 26 Dec 2007
Posts: 18
Location: Chennai, India

PostPosted: Thu Nov 27, 2008 10:43 am    Post subject: Its working!
Reply with quote

Frank,

Its working fine for me and I am getting the expected output.

Thanks a lot!
IBMMainframes rock!

Sourav
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


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