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

Syncsort split 1 record into multiple records


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

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 2:39 am
Reply with quote

Hi, Greetings to all. This is my first post.

I have a file with LRECL 7508 and the records in below format.
Field1 : 8 bytes, alphanumeric
Field2 : 7500 bytes , alphanumeric

Input will be like this

ab123456zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
bcd12345aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

My output file should be in length of 258 bytes, where field1 will be 8 bytes and field 2 should be split in multiples of 250 bytes like below. The records should be split like first line will have 258 bytes and the second line should have first 8 bytes as dots (.) and 250 bytes of field2. Instead of dots(.), spaces are also fine.

Output should be like this:

ab123456zzzzzzzzzzzzz
........zzzzzzzzzzzzz
........zzzzzzzzzzzzz
........zzzzzzzzzzzzz
cd123456aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa
........aaaaaaaaaaaaa

In syncsort, we do not have RESIZE option like in DFSORT. So we need to do this split without resize option. I can use newline operator '/' to achieve this but I need to use this for 30 times for 7500 length record.
Your suggestions are welcome and thanks in advance.

Regards,
Rajesh
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 03, 2014 3:15 am
Reply with quote

Quote:
Your suggestions are welcome and thanks in advance.

if You had started typing instead of posting You would have finished by now
icon_cool.gif
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: Mon Mar 03, 2014 5:02 am
Reply with quote

Without RESIZE what you've already suggested is what I'd do. So take enrico's accurate advice.

Code:
  BUILD=(1,8,0009,250,
      /,
       8C'.',0259,250,
      /,
       8C'.',0259,250,
.....



Really easy to R(epeat) in the editor and then type - you can even generate the statements with rexx/SORT/whatever. Edit macro. Once you have one, useful for other tasks.

You can also improve things using symbols/SYMNAMEs.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 6:16 am
Reply with quote

Hi Enrico and bill,
Thanks for the quick reply. The idea behind why I am not using the '/' operator is we are thinking of increasing the size of field2 to 32000 bytes. So I need some other method which can be used to split the records.
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: Mon Mar 03, 2014 6:38 am
Reply with quote

Well, there's always a programming language instead of SORT.

Do you mean 32,0008? Or will the last split record be short?

You are going to have this dataset on tape, or waste a lot of space with it?

Seriously, generate the cards, use symbols/SYMNAMES so you have a generic solution. Where's the problem?
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 9:19 am
Reply with quote

Input file LRECL will be 32008. Could you please give me an example to use symbols/SYMNAMES in this case?.
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: Mon Mar 03, 2014 12:47 pm
Reply with quote

Code:
//SYMNAMES DD *
KEY-VALUE,*,8,CH
DATA-001,*,250,CH
DATA-002,*,250,CH
DATA-003,*,250,CH
...
KEY-MASKS,8C' '
//SYMNOUNT DD SYSOUT=*


  OUTFIL BUILD=(KEY-VALUE,DATA-001,
              /,
               KEY-MASKS,DATA-002,
              /,
               KEY-MASKS,DATA-003,
.....


Do the necessary, either by hand or auotmation, then you have something which you can quickly change the sizes on, the content of the mask, whatever, without having to calculate a single position yourself.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Mon Mar 03, 2014 10:12 pm
Reply with quote

Thanks bill!!..This helps me.
Back to top
View user's profile Send private message
Rajesh Haridoss

New User


Joined: 22 Feb 2014
Posts: 16
Location: India

PostPosted: Tue Mar 11, 2014 9:52 am
Reply with quote

In the same input with 32000 byte LRECL, There is possibility that lot of bytes will be spaces. when I get no data/spaces for the 250 bytes while splitting the record or after splitting the records, I will get lot of empty lines. I need to remove those empty lines in the output file.I need to remove those empty lines in the same step/sort card. Any suggestions are welcome.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top