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

how to retrieve first ten chars of each record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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

Superior Member


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

PostPosted: Mon Jul 28, 2008 4:37 pm
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: 1287
Location: Chennai, India

PostPosted: Mon Jul 28, 2008 4:45 pm
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
Reply with quote

@anuj d

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

Superior Member


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

PostPosted: Wed Jul 30, 2008 11:20 am
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
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: 1287
Location: Chennai, India

PostPosted: Wed Jul 30, 2008 3:30 pm
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: 1702
Location: Australia

PostPosted: Wed Jul 30, 2008 3:36 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top