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

sort to remove fields from a file


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

Moderator Emeritus


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

PostPosted: Sat Jun 28, 2008 3:31 am
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)):

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

and here

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
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 Developer


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

PostPosted: Sat Jun 28, 2008 4:16 am
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
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: 1702
Location: Australia

PostPosted: Sat Jun 28, 2008 6:00 am
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
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

Moderator Emeritus


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

PostPosted: Sat Jun 28, 2008 6:51 am
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
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 Developer


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

PostPosted: Sat Jun 28, 2008 8:41 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top