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

Syncsort - using sort ot edit a flat file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Wed Mar 09, 2011 9:57 pm
Reply with quote

I have a requirement

Input data ( flat file )

Line -1 00000 320000
Line- 2 00000 320000
Line -3 00000 320000
Line -4 00000 320000
Line -5 600601ABCDEKFGSUEHYG58790896897 ABVBHHO 7U089
Line -6 600601CVKJJASJHADJKSD58790896897 ABVBHHO 7U089
Line- 7 600601aGHKJKLJHKJKLJHD58790896897 ABVBHHO 7U089

I want to read the input file , till it gets no spaces in coloumn 7 to 17
i.e. from Line -5 . Then I want to put 5th line data ( coloumn 7 to 17 )
to the 1st 4 records.

Output file should be



Line -1 000001ABCDEKFGS320000
Line- 2 000001ABCDEKFGS320000
Line -3 000001ABCDEKFGS320000
Line -4 000001ABCDEKFGS320000
Line -5 600601ABCDEKFGSUEHYG58790896897 ABVBHHO 7U089
Line -6 600601CVKJJASJHADJKSD58790896897 ABVBHHO 7U089
Line- 7 600601aGHKJKLJHKJKLJHD58790896897 ABVBHHO 7U089
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 09, 2011 10:17 pm
Reply with quote

Hello,

Which release of which sort product is used on your system?

If you don't know post the informational output from any sort including all message ids and content.
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Wed Mar 09, 2011 10:18 pm
Reply with quote

SYNCSORT , and ICETOOL is there
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Mar 09, 2011 10:22 pm
Reply with quote

Hello,

The other topic has been deleted.

ICETOOL on your system should invoke Synctool.
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Wed Mar 09, 2011 11:30 pm
Reply with quote

what should be the code to
copy data from 6th line and edit line 1 to 6 of the same file
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Mar 10, 2011 1:53 am
Reply with quote

Hello,

WHich release of Syncsort is being used?

Your example data does not appear to match your "rules". . .

Suggest you review/re-post the input & output sample data (Using the Code tag to perserve alignment improve readability) and review/re-post the rules from the 2 posts that have rules given.
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 6:04 pm
Reply with quote

I have a requirement

Input data ( flat file )
Line -1 00000########320000
Line- 2 00000########320000
Line -3 00000########320000
Line -4 00000########320000
Line -5 600601ABCDEKFGSUEHYG58790896897 ABVBHHO 7U089
Line -6 600601CVKJJASJHADJKSD58790896897 ABVBHHO 7U089
Line- 7 600601aGHKJKLJHKJKLJHD58790896897 ABVBHHO 7U089

I want to sequentially read the input file , till it gets no '#' in coloumn 6 to 13
i.e. from Line -5 . Then I want to put 5th line data ( coloumn 6 to 13 )
to the 1st 4 records.

Output file should be
Line -1 000001ABCDEKFGS320000
Line- 2 000001ABCDEKFGS320000
Line -3 000001ABCDEKFGS320000
Line -4 000001ABCDEKFGS320000
Line -5 600601ABCDEKFGSUEHYG58790896897 ABVBHHO 7U089
Line -6 600601CVKJJASJHADJKSD58790896897 ABVBHHO 7U089
Line- 7 600601aGHKJKLJHKJKLJHD58790896897 ABVBHHO 7U089
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Thu Mar 10, 2011 6:44 pm
Reply with quote

chandanhsbc

Rather than repeat or rephrase your requirement, you NEED to answer the question asked by Dick.

He's not asking for the fun of it, but to get some useful information to try and help you.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Mar 10, 2011 6:51 pm
Reply with quote

Your NEW example does not appear to match your stated requirements, either
The example INPUT you provide has EIGHT '#' characters from column 6 to 13 inclusive, with (in the first 5 records) the value '320000' starting in column 14.
The example OUTPUT you provide has TEN characters (1ABCDEKFGS) from column 6 to 15 being placed in the output field beginning at column 6, and the value '320000' beginning in column 16 - TWO bytes farther to the right than in the input file.
Yet you SAY that you only want to put the 5th line data (column 6 to 13) to the 1st 4 records, NOT the 5th line data (column 6 to 15). Columns 6 to 13 would only include 6th line characters '1ABCDEKF' and not the two additional characters 'GS' from columns 14-15 as shown in your example.
At the least, you need to provide requirements that are not conflicting.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Thu Mar 10, 2011 7:17 pm
Reply with quote

Dick repeatedly wrote:
Which release of which sort product is used on your system?
chandanhsbc wrote:
SYNCSORT , and ICETOOL is there

Suggest you execute this Job and post the entire SYSOUT here.
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*   
//SORTIN DD *
//SORTOUT DD DUMMY
//SYSIN DD *
  SORT FIELDS=COPY
/*
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Thu Mar 10, 2011 8:17 pm
Reply with quote

Edited post to remove suggested solution, due to ungrateful attitude of TS, as posted in following response.
Gimme, Gimme, Gimme.
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 8:21 pm
Reply with quote

I am not sure about the syncsort release , and how does it matter from coloumn number and all, thing is I am not getting the resoultion , rather getting lot of lesson on other stuff.

I want to put 5th line data ( from some particular coloumn to some particualr coloumn ) to 1st four line .

Is it possible by any type of sort command??
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 8:44 pm
Reply with quote

SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 200
z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 69D64, MODEL 2097 719
SYSIN :
SORT FIELDS=COPY
WER276B SYSDIAG= 3392034, 5870455, 5870455, 2705025
WER164B 6,884K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 272K BYTES USED
WER146B 32K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER410B 5,856K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE
WER410B 0 BYTES RESERVE REQUESTED, 156K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 0, OUT 0
WER169I RELEASE 1.3 BATCH 0492 TPF LEVEL 2.1
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 8:44 pm
Reply with quote

chandanhsbc

You just don't get it do you?

Quote:
rather getting lot of lesson on other stuff.


The 'other stuff' is MORE inportant than your silly resolution.

The reason the release matters is that, the resolution may vary depending on the release. One resolution may not work if the product is not up to the current release.

The 'other stuff' poeple are trying to HELP you with is this:
Should the resolution follow the example in the data?
Or should it follow the example in the rules?

They are different, so which is it?

The 'other stuff' is that if you want help, you need to be able to respond correctly to the questions being asked. This is important.

Most importantly you need to RESPECT those trying to help you for free.

If I were the moderator, I would lock this topic and ban the user.

Just me though. They are nicer than I am.
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 9:11 pm
Reply with quote

dave it was not for you , it was for coloumn number question
I am just looking to syntax , coloumn number and all should not matter .

For u aksing the release , I am very happy to answer ur question
And sorry if it hurted you..
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 9:17 pm
Reply with quote

I do not take things personally, so no harm there.

I am not hurt in the least bit.

If you just want syntax, then look in the manual.

If you want help from the experts here, then answer ALL of their questions, whether you think it matters or not.

The people helping you today have 30,000 posts combined. Do you think they would ask them if it did not matter?
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 9:31 pm
Reply with quote

ok.. sure will follow. that....
can I ask you now..
is my requirement clear.. or u want any other detail ?

and can u help me with the resloution ..?
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 9:37 pm
Reply with quote

You should clarify your requirements by answering this from Ronald:
Quote:
Your NEW example does not appear to match your stated requirements, either
The example INPUT you provide has EIGHT '#' characters from column 6 to 13 inclusive, with (in the first 5 records) the value '320000' starting in column 14.
The example OUTPUT you provide has TEN characters (1ABCDEKFGS) from column 6 to 15 being placed in the output field beginning at column 6, and the value '320000' beginning in column 16 - TWO bytes farther to the right than in the input file.
Yet you SAY that you only want to put the 5th line data (column 6 to 13) to the 1st 4 records, NOT the 5th line data (column 6 to 15). Columns 6 to 13 would only include 6th line characters '1ABCDEKF' and not the two additional characters 'GS' from columns 14-15 as shown in your example.
At the least, you need to provide requirements that are not conflicting.


Then you can say: I am sorry Ronald, I did not mean to have the gimme, gimme response (showing respect where it is deserved).

Then here can give you his the resolution based on his later comment.

As far as me, my job was the 'other stuff'
Back to top
View user's profile Send private message
chandanhsbc

New User


Joined: 27 Oct 2009
Posts: 11
Location: pune

PostPosted: Thu Mar 10, 2011 9:55 pm
Reply with quote

Well

my requiremt is a simple one , 1st 4 lines of a flat file is having space from coloumn 6 to cloumn 13

I want to pick data which is present in 5th line ( cloumn 6 to 13 ) and update 1st four line with that data only.

I tried doing it , in two steps , using easytrieve .
But I want to knw , if there is any better solution using sort.
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 Unable to interpret a hex value to De... COBOL Programming 4
No new posts Syncsort help SYNCSORT 3
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
Search our Forums:

Back to Top