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
 

 

how to retrieve first ten chars of each record

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

New User


Joined: 11 Jul 2008
Posts: 10
Location: Chennai

PostPosted: Mon Jul 28, 2008 4:23 pm    Post subject: how to retrieve first ten chars of each record
Reply with quote

i have 10 record inthe input file,each recordslength is 15.i want only first tencharacters of each records...
give me an idea...
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


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

PostPosted: Mon Jul 28, 2008 4:34 pm    Post subject:
Reply with quote

Any programming language I know of can read a record and ignore any part of it you want.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Jul 28, 2008 4:37 pm    Post subject:
Reply with quote

Hi,
Code:

  OPTION COPY       
  OUTREC FIELDS=(1,10)


You might use INREC as well.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Mon Jul 28, 2008 4:45 pm    Post subject: Reply to: how to retrieve first ten chars of each record
Reply with quote

sramesh,

Quote:
i have 10 record inthe input file,each recordslength is 15.i want only first tencharacters of each records...


what kind of file is your input file? FB or VB?
Back to top
View user's profile Send private message
srramesh
Currently Banned

New User


Joined: 11 Jul 2008
Posts: 10
Location: Chennai

PostPosted: Wed Jul 30, 2008 10:26 am    Post subject: Reply to: how to retrieve first ten chars of each record
Reply with quote

@anuj d

thanks...its working icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jul 30, 2008 11:20 am    Post subject:
Reply with quote

You are welcome.. icon_smile.gif

BTW, these are basic usage of some SORT products, start reading Manuals a little..they will help you better than me.. icon_smile.gif


- Ad
Back to top
View user's profile Send private message
srramesh
Currently Banned

New User


Joined: 11 Jul 2008
Posts: 10
Location: Chennai

PostPosted: Wed Jul 30, 2008 3:19 pm    Post subject:
Reply with quote

i have 10 record inthe input file.i want only first 5 records after sorting.....
give me an idea...
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Wed Jul 30, 2008 3:30 pm    Post subject: Reply to: how to retrieve first ten chars of each record
Reply with quote

rramesh,

Quote:
i have 10 record inthe input file.i want only first 5 records after sorting.....


This may not be the best idea.

Code a sort step to sort the entire file and then code another
sort step with the foll sort card

Code:

  SORT FIELDS=COPY,   
    STOPAFT=05
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Jul 30, 2008 3:36 pm    Post subject:
Reply with quote

Hi,

try this
Code:
//SORT     EXEC PGM=SORT                                               
//SORTIN   DD *                                                         
08                                                                     
07                                                                     
06                                                                     
04                                                                     
05                                                                     
03                                                                     
02                                                                     
01                                                                     
/*                                                                     
//OUT      DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT  FIELDS=(01,2,CH,A)                                             
  OUTFIL FNAMES=OUT,ENDREC=0005                                         
/*                                                                     



Gerry
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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
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. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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