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
 

 

Take the second column to another PS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Tue Feb 28, 2006 6:34 pm    Post subject: Take the second column to another PS
Reply with quote

i hav a records containing five columns.but i need to take the second and fifth column in to another ps.wats the code 4 it in jcl.

empno empname designation address salary i ahv actually but i need only empname and salary stored in my file.

thabks in advance
Back to top
View user's profile Send private message

nileshp

New User


Joined: 25 Feb 2006
Posts: 31

PostPosted: Tue Feb 28, 2006 6:45 pm    Post subject: Re: jcl problem
Reply with quote

Hi ,
You can use sort utility. And copy the required field into other ps.
Try the following

Code:

//SYSIN DD *
  SORT FIELDS=COPY
   INREC FIELDS=(7:2,5,20:10,3)
/*


EXPLANATION

1. SORT FIELDS=COPY

It is for copy records to output file

2. INREC FIELDS=(7:2,5,20:10,3) (for formatting)

Here we have two formatting,

1. 7:2,5 - data at 2nd position of input file with length 5
copied to 7th position of output file

2. 20:10,3 - data at 10th position of input file with length 3
copied to 20th position of output file



In above example, we can use OUTREC instead of INREC,

INREC adds, deletes, or reformat fields before the
records are sorted or merged. so that performance will
be improved

OUTREC adds, deletes, or reformat fields after the
records are sorted or merged.

stly wrote:
i hav a records containing five columns.but i need to take the second and fifth column in to another ps.wats the code 4 it in jcl.

empno empname designation address salary i ahv actually but i need only empname and salary stored in my file.

thanks in advance
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Tue Feb 28, 2006 6:59 pm    Post subject:
Reply with quote

Hey Stly,
Just check out this sort step
Code:

//JSTY0010 EXEC PGM=SORT                       
//SYSOUT    DD SYSOUT=*                       
//SYSABEND  DD SYSOUT=*                       
//SYSDUMP   DD SYSOUT=*                       
//SORTIN  DD DSN=<INPUT_DSN>,
//          DISP=SHR                           
//SORTOUT DD DSN=<OUTPUT_DSN>,           
//          DISP=(NEW,CATLG,DELETE),           
//          DCB=(RECFM=FB,LRECL=256,BLKSIZE=0),
//          SPACE=(CYL,(1,4),RLSE)             
//SYSIN DD *                                   
    SORT FIELDS=COPY                           
    OUTREC FIELDS=(10,10,50,20)               
/*                             |    |---------------------------|
                      starting                                       |---> Offset
                 column position
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 Feb 28, 2006 9:41 pm    Post subject:
Reply with quote

stly,

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
stly
Warnings : 1

New User


Joined: 25 Jul 2005
Posts: 93

PostPosted: Wed Mar 01, 2006 1:23 pm    Post subject:
Reply with quote

thank u very much to one n all.thank u very much frank.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm


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