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
 

 

A typical requirement with VB datasets..Can Sort do this??

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

New User


Joined: 15 Jul 2007
Posts: 23
Location: India

PostPosted: Tue Aug 14, 2007 12:51 am    Post subject: A typical requirement with VB datasets..Can Sort do this??
Reply with quote

Hi,

I have got a VB datasets with LRECL as 50.

It has got three record with length of
Record 1 : 20
Record 2 : 30
Record 3 : 40

Now, the question is

1. How can I increase the length of each record by 1 dynamicaly??? Like, the changed record should look like

Record 1 : 21
Record 2 : 31
Record 3 : 41

2. If we can do the above, will the RDW be automatically updated with the new record length ???

thanks,
mainframe_techie
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Aug 14, 2007 1:23 am    Post subject:
Reply with quote

I would think so, I do know that even though you have to pass the RDW forward (when rebuilding input recs to output recs), you do not have to specify the RDW value, the sort does that for you "auto-magically".... icon_lol.gif
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: Tue Aug 14, 2007 2:23 am    Post subject:
Reply with quote

Quote:
How can I increase the length of each record by 1 dynamicaly???


Quote:
Record 1 : 20


Quote:
Record 1 : 21



I assume this means Record 1 is 20 bytes long and Record 1 is 21 bytes long, respectively.

To increase the length by 1, you have to add 1 byte to the record which will automatically increase the length in the RDW by 1. For example, if you wanted to insert a binary zero byte after the RDW in each record, you could use these DFSORT control statements:

Code:

   OPTION COPY
   OUTREC BUILD=(1,4,X'00',5)
Back to top
View user's profile Send private message
mainframe_techie

New User


Joined: 15 Jul 2007
Posts: 23
Location: India

PostPosted: Fri Aug 24, 2007 2:54 am    Post subject: Reply to: A typical requirement with VB datasets..Can Sort d
Reply with quote

Frank,

But in this case the LRECL of the dataset is also increasing.
The requirement in LRECL should remain 50, but the length of the data and thus the RDW should increase.
However, when ever you are increasing the length of data using statement

OUTFIL OUTREC=(1,4,5,5,C'|',10,40)

( here | is inserted in data record )
in that case LRECL is also getting changed.

LRECL should remain same as 50, but only the datarecord and thus RDW should increase.
However this is not happening..any suggestions ??
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Aug 24, 2007 3:10 am    Post subject:
Reply with quote

Hello,

It will help if you post your jcl and control statements.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Aug 24, 2007 3:51 am    Post subject: Re: Reply to: A typical requirement with VB datasets..Can So
Reply with quote

mainframe_techie wrote:
The requirement in LRECL should remain 50, but the length of the data and thus the RDW should increase.
However, when ever you are increasing the length of data using statement

OUTFIL OUTREC=(1,4,5,5,C'|',10,40)

( here | is inserted in data record )
in that case LRECL is also getting changed.

LRECL should remain same as 50, but only the datarecord and thus RDW should increase.
However this is not happening..any suggestions ??
If you are referring to the maximum lrecl, it should only increase if you have a 50 byte record that you want to add a byte to - in that case, you will have to steal a byte from somewhere in the record....
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: Fri Aug 24, 2007 4:29 am    Post subject:
Reply with quote

mainframe_techie,

Look at the statement I posted:

Code:

   OUTREC BUILD=(1,4,X'00',5)


Now compare it to the statement you posted:

Code:

   OUTFIL OUTREC=(1,4,5,5,C'|',10,40)


Notice that I had a position (5) without a length for the last field whereas you have a position with a length (10,40).

When you give a position with a length as the last field, you get that fixed length field in every record making every record the same length. Because of that fixed length, if you add any bytes, the LRECL has to increase.

But when you give a position without a length as the last field, it tells DFSORT to take the bytes from that position to the end of the record, so you get variable length records. You can use LRECL=n on SORTOUT or a previously allocated data set with LRECL=n to keep LRECL=n. As long as the extra bytes don't increase the length of any record past the LRECL, you'll be ok.

Here's a DFSORT job to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN                                           
//SYSOUT    DD  SYSOUT=*                                           
//SORTIN DD DSN=...  input file (VB/50)
//SORTOUT DD LRECL=50,DSN=....  output file (VB/50)     
//SYSIN    DD    *                                                 
  OPTION COPY   
  OUTFIL OUTREC=(1,9,C'|',10)
/*


Note that this will work fine as long as you don't have a 50 byte record in your input file; 50 + 1 would require LRECL=51.
Back to top
View user's profile Send private message
mainframe_techie

New User


Joined: 15 Jul 2007
Posts: 23
Location: India

PostPosted: Fri Aug 24, 2007 5:35 am    Post subject: Reply to: A typical requirement with VB datasets..Can Sort d
Reply with quote

The problem still persists:

This the JCL I executed

//STEP1 EXEC PGM=ICEMAN
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN DD DSN=input file,
// DISP=SHR
//SORTOUT DD DSN=out put file,
// DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(3,1),RLSE),
// DCB=(LRECL=50,BLKSIZE=5000,RECFM=VB)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(1,4,5,5,C'#',10)
/*

After execution of this Job , the RDW is getting incremented, but again the LRECL of output file is also getting increased.

Please advise..
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Aug 24, 2007 5:45 am    Post subject:
Reply with quote

Hello,

Please post the sysout information from this execution.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 24, 2007 7:22 am    Post subject: Re: Reply to: A typical requirement with VB datasets..Can So
Reply with quote

mainframe_techie wrote:
The problem still persists:
After execution of this Job , the RDW is getting incremented, but again the LRECL of output file is also getting increased.

Please advise..


That seems perfectly sensible to me. What if there is a record that is already at the max length and you increase the RDW, what would you want done then, write it out with an invalid record length? Since you are making the records longer sort is just increasing the LRECL to prevent problems.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Fri Aug 24, 2007 8:55 am    Post subject: Reply to: A typical requirement with VB datasets..Can Sort d
Reply with quote

Yes, agreed.
The reason provided for this behaviour of sort is perfectly valid.

But what is the solution then ??
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Aug 24, 2007 5:47 pm    Post subject: Re: Reply to: A typical requirement with VB datasets..Can So
Reply with quote

ap_mainframes wrote:
Yes, agreed.
The reason provided for this behaviour of sort is perfectly valid.

But what is the solution then ??

After the sort copy the file to one with the shorter LRECL.
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: Fri Aug 24, 2007 8:39 pm    Post subject:
Reply with quote

mainframe_techie,

You're not paying attention to what people are telling you and you're not giving enough information for anyone to help you.

Show the messages you received in //SYSOUT.

Explain how you expect to increase the size of the records but keep the same LRECL if you have records that are the same length as the LRECL. Do you want to truncate bytes at the end of the record or what?
Back to top
View user's profile Send private message
mainframe_techie

New User


Joined: 15 Jul 2007
Posts: 23
Location: India

PostPosted: Fri Aug 24, 2007 10:04 pm    Post subject: Reply to: A typical requirement with VB datasets..Can Sort d
Reply with quote

Here is the sysout:

Quote:
SYNCSORT FOR Z/OS 1.2.2.2R U.S. PATENTS: 4210961, 5117495 (C) 2005 SYNCSO
z/OS 1.7.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 17B8A, MODEL 2064 106 LICEN
PARMEXIT : SIZE=MAX-64K
SYSIN :
SORT FIELDS=COPY
OUTFIL OUTREC=(1,4,5,5,C'#',10)
WER108I SORTIN : RECFM=VB ; LRECL= 616; BLKSIZE= 6233
WER110I SORTOUT : RECFM=VB ; LRECL= 617; BLKSIZE= 6160
WER405I SORTOUT : DATA RECORDS OUT 3; TOTAL RECORDS OUT 3
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER054I RCD IN 3, OUT 3
WER169I RELEASE 1.2 BATCH 0461 TPF LEVEL 2.2
WER052I END SYNCSORT - STEP1,,DIAG=8600,51CE,AA80,0066,CE7E,69C2,2E88


Also, here is what i expect.
In my case there is no VB record equal to logical record length.
Hence, what I need is

I need to increase the length of the data by 1 byte in all the records, with out increasing the LRECL of the dataset.

mainframe_techie[/quote]
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: Fri Aug 24, 2007 10:26 pm    Post subject:
Reply with quote

The information you're supplying is quite inconsistent.

Quote:
This the JCL I executed
...
//SORTOUT DD DSN=out put file,
// DISP=(NEW,CATLG,DELETE),SPACE=(TRK,(3,1),RLSE),
// DCB=(LRECL=50,BLKSIZE=5000,RECFM=VB)


Quote:

WER110I SORTOUT : RECFM=VB ; LRECL= 617; BLKSIZE= 6160


If you specified LRECL=50 on SORTOUT, you WOULD NOT get LRECL=617 for SORTOUT. You would need to specify LRECL=616 on SORTOUT to get LRECL=616 rather than LRECL=617.

You posted this in the DFSORT Forum, but the WER messages indicate you're using Syncsort rather than DFSORT.

If you had posted consistent information and were using DFSORT, I could have helped you. But you're using Syncsort, so I can't.

I'm moving this to the JCL Forum.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Aug 25, 2007 12:56 am    Post subject:
Reply with quote

Hello,

The sysout info you posted does not match the jcl and control info you posted.

Please start over and in one post copy/paste the jcl, the control statements, and the sysout info that are from the same run. Do not try to use any of the data previously posted. It would be best to run the test again and use that as your material to post here.

If you don't post the proper info, no one here will be able to help.
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


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