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

Take the second column to another PS


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 28, 2006 9:41 pm
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:

Use [URL] BBCode for External Links
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts first column truncated in search result IBM Tools 13
No new posts Split a record with data in a differe... DFSORT/ICETOOL 8
Search our Forums:

Back to Top