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
 

 

Syncsort - using sort ot edit a flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - using sort ot edit a flat file
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

Site Director


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

PostPosted: Wed Mar 09, 2011 10:17 pm    Post subject:
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    Post subject: Reply to: using sort ot edit a flat file
Reply with quote

SYNCSORT , and ICETOOL is there
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: Wed Mar 09, 2011 10:22 pm    Post subject:
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    Post subject: I still didnt got my answer :-(
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

Site Director


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

PostPosted: Thu Mar 10, 2011 1:53 am    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 10, 2011 6:44 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Thu Mar 10, 2011 7:17 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 8:44 pm    Post subject:
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    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 9:17 pm    Post subject:
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    Post subject:
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: 645
Location: Pennsylvania

PostPosted: Thu Mar 10, 2011 9:37 pm    Post subject:
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    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 3 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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