I have a PS file which is 18 bytes long. Each record is exactly 18 byte long. I have to insert a 3-byte character on position 1 in the file based on some conditions. Below is the sort card i am currently using :
After several hit and trials i am still getting the error. I am missing something here. Can anyone please help me to complete this.
Input File : (Each record is exactly 18 bytes long. Every record has variable number of spaces in the beginning. Spaces may not be visible after posting this.)
Thanks for the quick reply. I have tried your code but getting some errors. The input file was created after FTP a notepad file to Mainframe.
The data in the input is starting from 9th or 10th byte. When the post was pasted here, it somehow removed the leading spaces from all the records that is why it is showing that the data is starting from 1st byte. I am pasting the input file below :
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(9,3,ZD,EQ,000),OVERLAY=(1:C'GGA',4:4,15)),
IFTHEN=(WHEN=(9,3,CH,EQ,'IM1'),OVERLAY=(1:C'GGA',4:4,15)),
$
ICE113A E COMPARISON FIELD ERROR
IFTHEN=(WHEN=(10,3,ZD,CH,' 4'),OVERLAY=(1:C'GGA',4:4,15)),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
IFTHEN=(WHEN=(10,3,CH,EQ,' 3'),OVERLAY=(1:C'GGA',4:4,15)),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
IFTHEN=(WHEN=(9,2,CH,EQ,'WG'),OVERLAY=(1:C'AFG',4:4,15)),
$
ICE005A 0 BLANK NEEDED IN COLUMN 1 OR OPERATION NOT DEFINED CORRECTLY
IFTHEN=(WHEN=(9,3,CH,EQ,'IUL'),OVERLAY=(1:C'AFG',4:4,15)),
$
I can really use some guidance here because i need to deliver this tomorrow anyhow. As of now i am testing this on a sample data. Once it works here then i need to run same conditions on a file which contains more than 600,000 records so Please help !!
I can really use some guidance here because i need to deliver this tomorrow anyhow.
You should remember that people answer
ON THEIR OWN TIME
FREE OF CHARGE
if You have time constraints a forum is not the place to ask for help
a paid consultant - for the proper fee - will be happy to provide assistance according to your plans
the DFSORT manuals, or a simple search of the forums will certainly tell
the proper format of the comparison statement
if You had done the due diligence You should not have had the need to ask
and ... why in &heaven didn' t You follow the syntax of Magesh suggestion ?
The data in the file is starting from 9th byte instead of 1st byte. In each data there are leading spaces that is why i wrote the SORT card starting from 9th byte instead of 1st byte as Magesh suggested.
The input file was created after FTP a Notepad file. This is why i am confused about the data type which i need to mentioned in SORT card.
Code:
IFTHEN=(WHEN=(9,3,CH,EQ,'IM1'),OVERLAY=(1:C'GGA',4:4,15)),
$
ICE113A E COMPARISON FIELD ERROR
'IM1' seems to be a character format and that is why i have given CH here but it is giving comparison field error. I am not sure what else i can give here to make it work.
(Mod: corrected cut'n'paste in this post. Cleaned up earlier posts)