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

Sort cord for removing dots from file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Thu Feb 28, 2008 8:25 pm
Reply with quote

Hi,

I want to load an external file:

The Input is:

Code:

UQSE   SEC   UQSE
LEQU   SECD  LEQU
UQSE   *     UQSE



The output in mainframe file Required is:
Code:

---4---8---12
UQSESEC UQSE
UQSESECDABCD
UQSE*   ABCD



I Tried as below:
I opened it in text file then tried loading into mainframe.
The output is


Code:
UQSE.SEC.UQSE
UQSE.SECD.ABCD
UQSE.*.ABCD


I could have written a sort cord with sort fields=copy,outrec=() for this output file to get my required output but the second field varies from 1-4.

Please help.

Regards,
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: Thu Feb 28, 2008 10:28 pm
Reply with quote

Hello,

Quote:
I opened it in text file then tried loading into mainframe.
Where/how did you open this as a text file? How did you "load into mainframe"?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Feb 28, 2008 10:42 pm
Reply with quote

Binaya wrote:
The Input is:
Code:

UQSE   SEC   UQSE
LEQU   SECD  LEQU
UQSE   *     UQSE
Quote:
I could have written a sort cord with sort fields=copy,outrec=() for this output file to get my required output but the second field varies from 1-4.
So what if the second field is 1-4, your output doesn't seem to care.....
What are the little dots in your actual output, do a hex display and see if they are 'tabs' or what....
While you are at it, post the hex display for your input......
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Feb 29, 2008 10:01 am
Reply with quote

Quote:
Where/how did you open this as a text file? How did you "load into mainframe"?


I saved the excel file in a notepad. Then I tried loadind it into mainframe by ISPF option 6 / Action / send file to host.

Quote:
So what if the second field is 1-4, your output doesn't seem to care.....
What are the little dots in your actual output, do a hex display and see if they are 'tabs' or what....
While you are at it, post the hex display for your input......


Yes the dots are HEX for tabs.
HEX
.
0
5

The third field in the output has to start from 8'th position.
But as the second field in the input is * (3'rd row) i.e 1 character, the output starts from 5'th position.

It can be done by sorting

UQSE.SEC.UQSE
LEQU.SECD.LEQU
LEQU.*.LEQU

to

Code:
UQSESEC UQSE
LEQUSECDLEQU
LEQU*   LEQU
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Feb 29, 2008 10:17 am
Reply with quote

Hi,

Please help me for sort cord.

Input

Code:
UQSE.SEC.UQSE
UQSE.SECD.ABCD
UQSE.*.ABCD


Output

Code:
---4---8---12
UQSESEC UQSE
UQSESECDABCD
UQSE*   ABCD


The . in the input file has to be removed and the third field has to start from 9'th position.

Regards,
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: Fri Feb 29, 2008 9:44 pm
Reply with quote

Binaya,

Based on what you've said, you can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
UQSE.SEC.UQSE
UQSE.SECD.ABCD
UQSE.*.ABCD
/*
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC PARSE=(%01=(ABSPOS=6,ENDBEFR=X'05',FIXLEN=4),
               %02=(FIXLEN=4)),
        BUILD=(1,4,%01,%02)
/*
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Mon Mar 03, 2008 12:46 pm
Reply with quote

Thanks so much Frank..You are the Best...

Regards,
Back to top
View user's profile Send private message
aneeta

New User


Joined: 08 Dec 2005
Posts: 48
Location: Chennai

PostPosted: Mon Mar 03, 2008 11:27 pm
Reply with quote

Hi Frank,
I am curious to know wat does %,ABSPOS and ENDBEFR mean.Can you pls explain.

Thanks
Aneeta
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: Mon Mar 03, 2008 11:32 pm
Reply with quote

Aneeta,

For complete details on DFSORT's PARSE function and all of its parameter, see:

Use [URL] BBCode for External Links
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top