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
 

 

Syncsort - Multiple variable length recods to Fixed length

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
TS70363

New User


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

PostPosted: Wed Sep 11, 2013 3:45 pm    Post subject: Syncsort - Multiple variable length recods to Fixed length
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: 1713
Location: UK

PostPosted: Wed Sep 11, 2013 4:58 pm    Post subject:
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: 93
Location: Bangalore, India

PostPosted: Wed Sep 11, 2013 6:26 pm    Post subject:
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: 2158
Location: @my desk

PostPosted: Wed Sep 11, 2013 6:53 pm    Post subject:
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: 93
Location: Bangalore, India

PostPosted: Wed Sep 11, 2013 7:47 pm    Post subject: Reply to: Syncsort - Multiple variable length recods to Fixe
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: 93
Location: Bangalore, India

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Thu Sep 12, 2013 12:30 pm    Post subject: Reply to: Syncsort - Multiple variable length recods to Fixe
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 3 Fri Dec 02, 2016 9:47 am
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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