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

Conversion from Variable to Fixed


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

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Fri Jan 09, 2009 4:22 pm
Reply with quote

Hi,

I am having 3 files with different record lengths say,
1st file with record length:100
2nd file with record lenght :150
3rd file with record length: 40

All three are of Variable block.

And I want these 3 files to be concatenated/merged in to single file of maximum length which will be a fixed block record.

Could you please provide me the solution for this with the JCL ASAP.

This is bit urgent.

Thanks in advance,
Praveen.N
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jan 09, 2009 4:46 pm
Reply with quote

praveensn

Do certain fields from the different files need to be alligned, or is this a straight copy of the data asis with no internal movements.

Concatenated is different from merged. If this is really a merge, on what keys is the merge to be performed.

What have you tried so far, and what results did you get ?

Quote:
This is bit urgent.

It maybe urgent, but only for you. Please remember that forum members do this in their own time.
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Fri Jan 09, 2009 5:09 pm
Reply with quote

Hi,

Apoligies for that,


This is a straight copy of the three files in to one output file.

I have tried to copy the 2 input files of different record lengths, where one is of 240 and another is 479 in to an output file of 600 record length through VTOF (Variable to Fixed).

Please find the JCL for this.

Code:

//STEP040   EXEC PGM=SORT                                                         
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=nupyn24.DB2NAT.DISK200,DISP=SHR         
//          DD DSN=nupyn24.DB2NAT.DISk700C,DISP=SHR         
//SORTOUT   DD DSN=nupys45.SORT.OUTPUT1,                   
//             DISP=(,CATLG,DELETE),UNIT=SYSDA,               
//             SPACE=(CYL,(300,100),RLSE)                   
//SYSIN     DD  *                                           
  SORT FIELDS=(5,470,CH,A)                                 
  OUTFIL FNAMES=SORTOUT,VTOF,                               
  OUTREC=(1,600)                                           
/*                                                         


Here nupyn24.DB2NAT.DISK200 is of record length 240 and

nupyn24.DB2NAT.DISk700C is 479 record length.

And i am trying to copy the data of the 2 files in to
nupys45.SORT.OUTPUT1 which is of 600 length but not able to do so.

I am getting the below error.

RECORD TYPE IS V - DATA STARTS IN POSITION 5
END OF SORTOUT FIELD BEYOND MAXIMUM RECORD LENGTH

Thanks,
Praveen.N
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Fri Jan 09, 2009 5:11 pm
Reply with quote

Adding to the above both the records are Variable block and I want them to convert it to a fixed block of maximum say 600 record length.

Thanks,
Praveen.N
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: Fri Jan 09, 2009 10:34 pm
Reply with quote

Here's a DFSORT job that will do what you asked for. Since you said you wanted to do a COPY, I used OPTION COPY rather than SORT. I assumed you didn't want to keep the RDW of the VB files so I used 5,475. The trick is to specify p,m according to the maximum LRECL and then use 600:X to pad the records out.

Code:

//STEP040   EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=nupyn24.DB2NAT.DISK200,DISP=SHR
//          DD DSN=nupyn24.DB2NAT.DISK700C,DISP=SHR
//SORTOUT   DD DSN=nupys45.SORT.OUTPUT1,
//             DISP=(,CATLG,DELETE),UNIT=SYSDA,
//             SPACE=(CYL,(300,100),RLSE)
//SYSIN     DD  *
  OPTION COPY
  OUTFIL VTOF,BUILD=(5,475,600:X)
/*
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jan 09, 2009 10:47 pm
Reply with quote

I suppose there was some reason for posting the same question multiple times within such a short time frame icon_sad.gif

The other has been locked. . .

d
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: Fri Jan 09, 2009 10:54 pm
Reply with quote

Dick,

I deleted the dup thread after you locked it. No reason to keep it.
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Tue Jan 13, 2009 11:16 am
Reply with quote

Frank,


Thanks a lot for the JCL, it is working fine.


Thanks,
Praveen.N
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Wed Feb 11, 2009 7:45 pm
Reply with quote

Hi All,

I had one more query,

I am having 3 files with different record lengths say,
1st file with record length:100
2nd file with record lenght :150
3rd file with record length: 40

All three are of Variable block.

And I want these 3 files to be concatenated/merged in to single output file which is also a variable block.


Thanks in advance,
Praveen.N
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 11, 2009 7:52 pm
Reply with quote

Use IDCAMS, SORT, IEBGENER, ... with input as 3 concatenated files and output is one file with LRECL at least as long as longest input file LRECL.
Back to top
View user's profile Send private message
praveensn

New User


Joined: 30 Jul 2008
Posts: 32
Location: Pune

PostPosted: Wed Feb 11, 2009 8:17 pm
Reply with quote

Robert,

Thanks a lot.

Its working fine now.

Regards,
Praveen.N
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 Store the data for fixed length COBOL Programming 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Pulling a fixed number of records fro... DB2 2
No new posts 10 byte RBA conversion DB2 2
No new posts 10 byte RBA conversion -non applicati... JCL & VSAM 1
Search our Forums:

Back to Top