Hi Team,
We have a PS File with the following format
Login ID Salary ID
F12345
A12345 A12345
C12345
D12345 D12345
We are using SYNCSORT in the Job to format the file and we are getting the output in the following fashion
INREC FIELDS=(1:1,6,
7:C',',
8:8,6,
14:C',')
SORT FILEDS=COPY
F12345, ,
A12345,A12345,
C12345, ,
D12345,D12345,
Could you please let us know if we can remove null columns as shown below
F12345,,
A12345,A12345,
C12345,,
D12345,D12345,
Please provide us the possibility for writting the code
With Regards,
Sandeep
How to remove extra spaces by using sync sort
Moderators: Frank Yaeger, Moderator Group
-
- Member
- Posts: 10
- Joined: Wed Apr 02, 2014 9:59 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
Code: Select all
INREC IFTHEN=(WHEN=(8,6,CH,EQ,C' '),
BUILD=(1,6,
C',,',
80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(1,6,
C',',
8,6,
C',',
80:X))
-
- Member
- Posts: 10
- Joined: Wed Apr 02, 2014 9:59 pm
Hi Williams,
Thanks for the fast responce ,
We are having input file in the following format
AAAAA,, BBBBBBB,
AAAAA,BBBBBBB,,
COuld you please let us know if the code mentioned above will work to my scenerio
AAAAA,,BBBBBBB, -- > 3 Columns
AAAAA,BBBBBBB,, -- > 3 Columns
Let us know if we need to remove Fields parameter which we mentioned earlier
Sorry for Disturbing u again
Hope understood our problem
Thanks for the fast responce ,
We are having input file in the following format
AAAAA,, BBBBBBB,
AAAAA,BBBBBBB,,
COuld you please let us know if the code mentioned above will work to my scenerio
AAAAA,,BBBBBBB, -- > 3 Columns
AAAAA,BBBBBBB,, -- > 3 Columns
Let us know if we need to remove Fields parameter which we mentioned earlier
Sorry for Disturbing u again
Hope understood our problem
-
- Member
- Posts: 10
- Joined: Wed Apr 02, 2014 9:59 pm
-
- Active Member
- Posts: 732
- Joined: Thu May 24, 2012 4:07 am
You've changed the input. How could you expect code for a different input to work on something else that you throw at it?
FIELDS is equal to BUILD. FIELDS is there for backwards-compatibilty, it is much clearer to use BUILD, which does not have multiple meanings in SORT (whereas FIELDS does).
You need to, catefully, re-post your data inside the Code tags, so that the data is in a fixed-font and it looks like a green screen, like the code in my previous response. Click on Quote there if you need to see how.
Show all the possible variations of input that you want to deal with, and show the data has having representative values (like we need to know if you can have embedded spaces, perhaps).
FIELDS is equal to BUILD. FIELDS is there for backwards-compatibilty, it is much clearer to use BUILD, which does not have multiple meanings in SORT (whereas FIELDS does).
You need to, catefully, re-post your data inside the Code tags, so that the data is in a fixed-font and it looks like a green screen, like the code in my previous response. Click on Quote there if you need to see how.
Show all the possible variations of input that you want to deal with, and show the data has having representative values (like we need to know if you can have embedded spaces, perhaps).
-
- Member
- Posts: 10
- Joined: Wed Apr 02, 2014 9:59 pm
Hi Sir,
Extremely sorry for the confusion created by me in my earlier posts .
I am having the input file in the following format
Pos 1 - 5 EMP_ID
POS 6 EMPTY SPACE
POS 7-9 LAST NAME
POS 10 EMPTY SPACE
POS 11-13 FIRST NAME
Pls find the input file attached
Desired OUTPUT :
1. FIRST COLUMN SHOULD HAVE EMPID FOLLOWED BY COMMA
2. SECOND COLUMN - IF EMPID STARTS WITH A/B THEN EMPID SHOULD BE DISPLAYED IN SECOND COLUMN DELIMETED BY COMMA,
IF NOT MATCHING , THEN SIMPLY DELIMETED COLUMN BY COMMA
3.THIRD COLUMN - LAST NAME DELIMITED BY COMMA
4.FOURTH COLUMN - IF EMPID STARTS WITH C THEN EMPID SHOULD BE DISPLAYED DELIMETED BY COMMA , ELSE SIMPLY DELIMTED BY COMMA
5.FIFTH COLUMN - FIRSTNAME
Could you please help us in resolving this post
WithRegards
Sandeep
Extremely sorry for the confusion created by me in my earlier posts .
I am having the input file in the following format
Pos 1 - 5 EMP_ID
POS 6 EMPTY SPACE
POS 7-9 LAST NAME
POS 10 EMPTY SPACE
POS 11-13 FIRST NAME
Pls find the input file attached
Code: Select all
=COLS> ----+----1----+--
****** *****************
'''''' A1234 XYZ TRE
'''''' B1234 TRE HF
'''''' A5643 RRR UUU
'''''' B4637 DDD YDS
'''''' C2345 DDD RMS
'''''' X1234 DDD CMS
'''''' Y1234 DDD YRE
''''''
1. FIRST COLUMN SHOULD HAVE EMPID FOLLOWED BY COMMA
2. SECOND COLUMN - IF EMPID STARTS WITH A/B THEN EMPID SHOULD BE DISPLAYED IN SECOND COLUMN DELIMETED BY COMMA,
IF NOT MATCHING , THEN SIMPLY DELIMETED COLUMN BY COMMA
3.THIRD COLUMN - LAST NAME DELIMITED BY COMMA
4.FOURTH COLUMN - IF EMPID STARTS WITH C THEN EMPID SHOULD BE DISPLAYED DELIMETED BY COMMA , ELSE SIMPLY DELIMTED BY COMMA
5.FIFTH COLUMN - FIRSTNAME
Code: Select all
A1234,A1234,XYZ,,TRE
B1234,B1234,TRE,,HF
A5643,A5643,RRR,,UUU
B4637,B4637,DDD,,YDS
C2345,,DDD,C2345,RMS
X1234,,DDD,,CMS
Y1234,,DDD,,YRE
Could you please help us in resolving this post
WithRegards
Sandeep
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page