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
 

 

sort to remove fields from a file

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

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat Jun 28, 2008 3:08 am    Post subject: sort to remove fields from a file
Reply with quote

I have to remove some fields from a file from 4 to 18th position,


they are alphnumeric


Please provide me the syntax

Thanks.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jun 28, 2008 3:31 am    Post subject:
Reply with quote

Hello,

Quote:
Please provide me the syntax


Please look here (and on many other nearby pages in that manual (which is available via the "IBM Manuals" link at the top of the page)):

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/ICE1CA10/3.8.2.1

and here

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/ice1ca10/3.8.2.3
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat Jun 28, 2008 3:53 am    Post subject: Reply to: sort to remove fields from a file
Reply with quote

At this point of time i am unable to make out the things please help me in giving the syntax.


my data is some what like this-

101b56602
100067k89
10089m90


I want exclude these values
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: Sat Jun 28, 2008 4:16 am    Post subject:
Reply with quote

Quote:
I want exclude these values


Which values do you want to exclude exactly?

What is the expected output exactly?

You need to be clearer about what you want to do.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat Jun 28, 2008 5:49 am    Post subject:
Reply with quote

Hi,


I have recived another file now and the requirement has bit changed.

The file is like this----

001000750750B058.±cx
001000750750B078.kGä
001000750750B100.kGß
001000750750B185.kGÞ
001000750750B186.kG®
001000750750H164.ïÈ/
001000750751AAAG.þt.
001000750751AAB5.ÐÈ·
001000750751AAD5.þt«
001000750751AAFT.þt¨
001000750751AAGP.þtR
001000750751AAGU.þtù
001000750751AAL1.þu
001000750751AAL5.þuà
001000750751AAL7.þuã
001000750751AASS.±.Ñ
001000750751AAUC.±.º
001000750751AAWT.±Qm
001000750751AA62.Ë.è


I just require last 4 bytes , and i need to create a new file which will have just these 4 bytes.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat Jun 28, 2008 6:00 am    Post subject:
Reply with quote

You certainly know how to lose friends and win enemies.


Gerry
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat Jun 28, 2008 6:06 am    Post subject: Reply to: sort to remove fields from a file
Reply with quote

Dear Gcicchet,


Please provide me the solution,

will be greatful to u

Thanks
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Jun 28, 2008 6:51 am    Post subject:
Reply with quote

Hello,

Maybe i have completely missed something, but what purpose is served by copying all of the records to get only the last 4 bytes? Why not simply use the file you have and reference those bytes in whatever process is needed?

When another file is received in yet another format, what will be needed then?

If you better explain what you need to do, we may be able to offer more usable suggestions.

When posting this type of question you need to include the relevant positons in the input and output and the "rules" to get from the input to the output. You also need to mention the recfm and lrecl of the input and output files.

If each file that arrives will be diffeent, your best bet is to take the time to understand the linked material and then you can create new control statements for each new requirement. There are also multiple examples in the forum.
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Sat Jun 28, 2008 7:00 am    Post subject: Reply to: sort to remove fields from a file
Reply with quote

Thanks for your response.

This file is been given for a temporary use as our actual files are not working now.

I have been asked to extract the last 4 bytes from this file and create a new file, and this file will be used in further processing.
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: Sat Jun 28, 2008 8:41 pm    Post subject:
Reply with quote

Assuming your input file has RECFM=FB and the bytes you want are in positions 17-20 (as they appear in your example), you can use this DFSORT job:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION COPY
  OUTREC BUILD=(17,4)
/*
Back to top
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Mon Jun 30, 2008 8:21 pm    Post subject: Reply to: sort to remove fields from a file
Reply with quote

Thanks Frank.

I have done using control card for sort as-

SORT FIELDS=COPY
OUTREC FIELDS=(17, 4)

and it worked.

Thank you.

Thanks to all.
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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