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

Syncsort - Multiple variable length recods to Fixed length


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Sep 11, 2013 3:45 pm
Reply with quote

Hi,

Input File layout

Code:
01  :PFX:-RECORD.                                             
    03  :PFX:-LICENCE-NUMBER         PIC X(08).               
    03  :PFX:-LICENSEE-NAME-LEN      PIC 9(03) COMP-3.       
    03  :PFX:-TRADING-NAME-CNT       PIC 9(03) COMP-3.       
    03  :PFX:-LICENSEE-NAME.                                 
        05  :PFX:-LICENSEE-NAME-X    PIC X(01) OCCURS 0 TO 120
                                     DEPENDING ON             
                                     :PFX:-LICENSEE-NAME-LEN.
    03  :PFX:-TRADING-NAME.                                   
        05  :PFX:-TRADING-NAME-X     PIC X(100) OCCURS 0 TO 50
                                     DEPENDING ON             
                                     :PFX:-TRADING-NAME-CNT. 


Is it possible to convert the :PFX:-LICENSEE-NAME field to a fixed length of 120 by getting the length from :PFX:-LICENSEE-NAME-LEN using SYNCSORT and then append the TRADING-NAME
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Sep 11, 2013 4:58 pm
Reply with quote

I am not sure what you are asking! Please supply sample input/output, RECFM, LRECL.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Sep 11, 2013 6:26 pm
Reply with quote

Hi,

My requirement is to migrate many such datasets mapped to copybook structure (ODO) to fixed bytes layout.

For the above example, input will look like below:

lrecl = 5136
recfm = VB



Code:

Field                    Picture  Start   Data               
PFX-LICENCE-NUMBER       X(08)        1   01234567           
PFX-LICENSEE-NAME-LEN    9(03)        9      8               
PFX-TRADING-NAME-CNT     9(03)       11      1               
PFX-LICENSEE-NAME                    13   ABC. PVT           
                                                             
PFX-TRADING-NAME                     21   APPLE BANANA COMPANY


Code:

Field                    Picture  Start   Data         
PFX-LICENCE-NUMBER       X(08)        1   02345678     
PFX-LICENSEE-NAME-LEN    9(03)        9     10         
PFX-TRADING-NAME-CNT     9(03)       11      2         
PFX-LICENSEE-NAME                    13   DEFGH LTD.   
                                                       
PFX-TRADING-NAME                     23   D. ASSOCIATES


Here, we need to move ABC. PVT/DEFGH LTD to a fixed length field of X(120) and then start the TRADING NAME from 13 + 120 = 134 th position for all the records.

Hence I am trying to find out a way where we know the starting position of LICENSEE-NAME (in first case it is 21 while in the second case it is 23)


Thanks
TS70363
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 11, 2013 6:53 pm
Reply with quote

Was that a typo?...Looks like the starting position of TRADING-NAME is the one which is varying. You could write a bit of code to achieve this.
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Wed Sep 11, 2013 7:47 pm
Reply with quote

Hi,

I have many such files with different layouts and hence looking for an approach thru Sort
Back to top
View user's profile Send private message
TS70363

New User


Joined: 07 Apr 2010
Posts: 94
Location: Bangalore, India

PostPosted: Thu Sep 12, 2013 7:43 am
Reply with quote

Can this be achieved with sort?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Sep 12, 2013 12:30 pm
Reply with quote

Yes, I think so.,

You'd be looking at around 22 IFTHENs (minimum) but they'd all be doing the same thing.

Do you have a couple of other examples of your files?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top