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

How to modify field size of a VSAM dataset


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

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Mon Jul 27, 2009 11:39 pm
Reply with quote

A VSAM file has records of length 80.The record structure is as follows:
(the file has 100000 records)
Emp-id(5),Filler(1),Empname(20),Filler(1),Empaddr(30),Filler(1),PostalID(5),Filler(1),Areaname(10),Filler(1),Deptid(5)

Now I need to remove all fillers and increase my empaddr to 35.The final structure should look something like this:

Emp-id(5),Empname(20),Empaddr(35),PostalID(5),Areaname(10),Deptid(5)

What are the best programmatical way I can achieve it.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jul 27, 2009 11:41 pm
Reply with quote

I'd use a SORT program to reconfigure the layout as necessary.
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Mon Jul 27, 2009 11:44 pm
Reply with quote

Hi kevin,
Quote:

I'd use a SORT program to reconfigure the layout as necessary.



Can u give the options that I can use on sort to achieve this...
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Jul 27, 2009 11:51 pm
Reply with quote

Sort topics for the SYNCSORT product are to be posted in the JCL Forum with the word "SYNCSORT" used somewhere in the Subject line. You should try to also indicate the release of the product you're using.

Sort topics for the the DFSORT product are to be posted in the DFSORT/ICETOOL Forum.

You provided most of the necessary details, although you didn't mention what type of VSAM file (ESDS, RRDS, KSKS) this is referring to. That is an important detail. Also, please try to not use the "COBOLEASE" since not everyone is familiar with COBOL field definitions and terminology. Offsets and field types would be better.
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Tue Jul 28, 2009 12:08 am
Reply with quote

Quote:
Sort topics for the SYNCSORT product are to be posted in the JCL Forum with the word "SYNCSORT" used somewhere in the Subject line. You should try to also indicate the release of the product you're using.
Sort topics for the the DFSORT product are to be posted in the DFSORT/ICETOOL Forum.


I am not aware of SYNCSORT yet.I could have surely posted it in DFSORT,if I knew the best way is DFSORT to achieve it.

Quote:
You provided most of the necessary details, although you didn't mention what type of VSAM file (ESDS, RRDS, KSKS) this is referring to. That is an important detail.


I mainly need it for ESDS and KSDS file types.

let me know if some more info is required
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: Tue Jul 28, 2009 1:27 am
Reply with quote

rsingh,

Here's a DFSORT job that will do what you asked for. Since the input is a VSAM file, we use RECORD TYPE=F to tell DFSORT to process it as fixed-length records. Note that if the output is a KSDS, the location of the keys must correspond to what was defined for the file.

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD *
I_Emp_id,1,5
I_filler1,*,1
I_Empname,*,20
I_filler2,*,1
I_Empaddr,*,30
I_filler3,*,1
I_PostalID,*,5
I_filler4,*,1
I_Areaname,*,10
I_filler5,*,1
I_Deptid,*,5
O_Emp_id,1,5
O_Empname,*,20
O_Empaddr,*,35
O_PostalID,*,5
O_Areaname,*,10
O_Deptid,*,5
/*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
   OPTION COPY
   RECORD TYPE=F
   INREC BUILD=(O_Emp_id:I_Emp_id,O_Empname:I_Empname,
    O_Empaddr:I_Empaddr,O_PostalID:I_PostalID,
    O_Areaname:I_Areaname,O_Deptid:I_Deptid)
/*


Alternatively, you can do it like this without DFSORT Symbols:

Code:

//S2    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY                                                       
  RECORD TYPE=F
  INREC BUILD=(1:1,5,6:7,20,26:28,30,61:59,5,66:65,10,76:76,5)       
/*
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Tue Jul 28, 2009 6:29 pm
Reply with quote

Thanks Frank....
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Wed Jul 29, 2009 4:56 pm
Reply with quote

hi frank,

while implementing the second code,
Quote:
//S2 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
RECORD TYPE=F
INREC BUILD=(1:1,5,6:7,20,26:28,30,61:59,5,66:65,10,76:76,5)
/*


i got the following error........

DFSORT V1R5
INVALID INREC OR OUTREC STATEMENT OPERAND
MISSING FIELDS OPERAND DEFINER

don't know what i m doing wrong................
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Jul 29, 2009 9:19 pm
Reply with quote

rsingh,

Please post the complete sysout with error messages.
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Thu Jul 30, 2009 6:34 pm
Reply with quote

Skolusu,
Below is the complete sysout
Quote:

1ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 06:57 ON THU JUL 30, 2009 -
0 OPTION COPY 00060011
RECORD TYPE=F 00061004
INREC BUILD=(1:1,5,6:7,10,17:18,10,28:29,15,34:40,5) 00070011
$
ICE104A 0 INVALID INREC OR OUTREC STATEMENT OPERAND
ICE012A 2 MISSING FIELDS OPERAND DEFINER
ICE751I 0 C5-BASE C6-BASE C7-BASE C8-Q83041 E7-BASE
ICE052I 3 END OF DFSORT


Note: the format of records given is the actual input data format which i have used,which is different from the record discussed in previous post.Hope this doesn't effect the analysis much.

my record format is mentioned below:
Quote:
A0001 MANISH KUMAR JAYANAGAR D0001
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Thu Jul 30, 2009 7:30 pm
Reply with quote

Hi,

If I use "Fields" option in place of "build",the code runs fine.....

so, the final code looks something like this:

Code:
//STEP1 EXEC PGM=SORT                                   
//SYSPRINT DD SYSOUT=*                                   
//SYSOUT DD SYSOUT=*                                     
//SORTIN DD DSN=. .  . i/p file             
//SORTOUT DD DSN=. . .o/p file     
//SYSIN DD *                                             
    OPTION COPY                                         
    RECORD TYPE=F                                       
    INREC FIELDS=(1:1,5,6:7,10,16:18,10,26:28,10,40:40,5)
/*


Note: the record structure is again changed,for my testing purpose

But still eager to know why "build" option is giving error.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jul 30, 2009 9:19 pm
Reply with quote

rsingh,

Support for BUILD operator for z/OS DFSORT V1R5 PTF UQ95214 is made available in December, 2004. It is been almost 5 years and your shop is way behind updating the DFSORT. Talk to your systems programmers and get updated to the latest PTF.
Back to top
View user's profile Send private message
rsingh

New User


Joined: 24 Mar 2009
Posts: 10
Location: bangalore

PostPosted: Thu Jul 30, 2009 10:19 pm
Reply with quote

Thanks Skolusu
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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top