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
 

 

I want the sort JCL which will copy the records from PS to K

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

New User


Joined: 08 Feb 2006
Posts: 3

PostPosted: Thu May 25, 2006 10:01 am    Post subject: I want the sort JCL which will copy the records from PS to K
Reply with quote

Hi friends,





Help me??????

I want the sort JCL which will copy the records from PS to KSDS. If anyone know, please forward the JCL as soon as possible.
Back to top
View user's profile Send private message

gskulkarni

New User


Joined: 01 Mar 2006
Posts: 70

PostPosted: Thu May 25, 2006 10:06 am    Post subject:
Reply with quote

Code:
//STEP010  EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTMSG  DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN   DD DSN='dataset',
//         DISP=(OLD,KEEP)
//*
//SORTOUT  DD DSN='new_seq_sortout_dataset',
//         DISP=(NEW,CATLG,DELETE),
//         SPACE=(CYL,(100,100),RLSE),
//         UNIT=SYSDA,
//         DCB=SYS1.DSCB
//*
//SYSIN    DD *
SORT order for your KSDS
/*
//STEP020  EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTMSG  DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SORTIN   DD DSN='New_sorted_from_previous_step',
//         DISP=(OLD,KEEP)
//*
//SORTOUT  DD DSN='old_KSDS',
//               DISP=OLD,
//*
//SYSIN    DD *
SORT order for your KSDS
/*
Back to top
View user's profile Send private message
devikanth

New User


Joined: 30 Jun 2005
Posts: 2
Location: chicago

PostPosted: Thu May 25, 2006 12:32 pm    Post subject: Code
Reply with quote

//IDCAMS1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//OUTFL DD DSN=Q1.Q2.Q3.PDK,DISP=OLD
//INFLE DD DSN=&&INPUT,DISP=(OLD,DELETE)
//SYSIN DD *
DELETE Q1.Q2.Q3.PDK
SET MAXCC=0
DEFINE CLUSTER (NAME(Q1.Q2.Q3.PDK) -
VOLUMES(&UNITVOL) -
CYLINDERS (5 5) -
KEYS(1 0) FREESPACE(0 0) -
RECORDSIZE(74 74) -
SHAREOPTIONS(3 3) -
REUSE) -
DATA (NAME(Q1.Q2.Q3.PDK) -
CISZ(4096)) -
INDEX (NAME(Q1.Q2.Q3.PDK) -
CISZ(4096))
REPRO INFILE (INFLE) OUTDATASET (Q1.Q2.Q3.PDK)
//*

Here fields KEYS,RECORDSIZE,CISZ depends upon your data.

Thanks
Devikanth
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: Thu May 25, 2006 9:06 pm    Post subject:
Reply with quote

If the ps data set already has the keys in the correct order for the KSDS, you can use a DFSORT job like this:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   ps file
//SORTOUT DD DSN=...  VSAM KSDS
//SYSIN DD *
  OPTION COPY
/*


If the ps data set does not have the keys in the correct order for the KSDS, you can use a DFSORT job like this:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...   ps file
//SORTOUT DD DSN=...  VSAM KSDS
//SYSIN DD *
  SORT FIELDS=(p,m,BI,A)
/*


where p is the starting position of the key and m is the length of the key.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am


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