|
View previous topic :: View next topic
|
| Author |
Message |
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,12,13:13,4,ZD,BI,LENGTH=2,15:17,10,25:27,12,PD,ZD,
EDIT=(STTTTTTTTT.TTT),SIGNS=(,-),31:39,12,PD,ZD,EDIT=TTTTTT.TT,
EDIT=(STTTTTTTTT.TTT),SIGNS=(,-))
my requirement is convert PD to ZD then put in EDIT
please help regarding syntax |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Is there some reason you posted your question to a topic that has been inactive for almost 4 years. . .?
When you have a question, you should start a new topic for your question.
Also, i suspect you only want the edited output - not a ZD value and an edited value? |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Add on. . .
Please show some sample input data and the output you want from that sample input data. Mention the recfm and lrecl of the files. |
|
| Back to top |
|
 |
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
I load thIS FILE FROM EXCEL TO MAINFRAME
AND I TAKE ONLY FOR 51 COLUMN
AS IN EXCEL ALL COLUMN IS KNOWN AS CHAR
file length is 51
BELGDCDL1 0020BANADA 000000000.00999999900.000.05
BELGDCDL1 0028BANADA 000000000.00999999900.000.05
BELGDCDL1 0193BANADA 000000000.00999999900.000.05
NOWI WANT TO UPLOAD IN BELOW FILE AND FORAMT OF THE FILE
01lang
10 Code Pic X(12).
10 No PiC S9(4) comp.
10 model Pic X(10)
10 amt pic S9(9)V9(2) usage comp-3
10 Dt-amt pIC s9(9)v9(2) USAGE COMP-3.
10 dt-pct pIC s9(1)v9(2) USAGE cOMP-3.
THROU SORT I WANT TO DO THAT |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| my requirement is convert PD to ZD then put in EDIT |
You either convert to ZD or you convert using EDIT. You don't do both.
Here's an example of the correct syntax for editing a PD field:
25:27,12,PD,EDIT=(STTTTTTTTT.TTT),SIGNS=(,-) |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
santhosh100678,
If your intention is to create the file to the layout you have shown then use the following DFSORT JCL
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5-
BELGDCDL1 0020BANADA 000000000.00999999900.000.05
BELGDCDL1 0028BANADA 000000000.00999999900.000.05
BELGDCDL1 0193BANADA 000000000.00999999900.000.05
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,9,3X, $ CODE
11,4,ZD,TO=BI,LENGTH=2, $ NO
15,6,4X, $ MODEL
22,12,UFF,TO=PD,LENGTH=6, $ AMT
34,12,UFF,TO=PD,LENGTH=6, $ DT-AMT
46,04,UFF,TO=PD,LENGTH=2) $ DT-PCT
//* |
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| My requirement is convert PD to ZD then put in EDIT |
Hmmm ... the requirement as originally described seems to have nothing to do with the actual requirement. |
|
| Back to top |
|
 |
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
Hi my requirement is to insert in table before inserting table i foramtt the file as per table structure
I copy this file from excel to mainframe
BELGDCDL1 0020BANADA 000000000.00999999900.000.05
BELGDCDL1 0028BANADA 000000000.00999999900.000.05
BELGDCDL1 0193BANADA 000000000.00999999900.000.05
and length is 51 file but when i copy this file and put in table
01lang
10 Code Pic X(12).
10 No PiC S9(4) comp.
10 model Pic X(10)
10 amt pic S9(9)V9(2) usage comp-3
10 Dt-amt pIC s9(9)v9(2) USAGE COMP-3.
10 dt-pct pIC s9(1)v9(2) USAGE cOMP-3.
when i use only this card
OUTREC FIELDS=(1:1,12,13:13,4,ZD,BI,LENGTH=2,15:17,10,25:27,12,PD,ZD,
EDIT=(STTTTTTTTT.TTT),SIGNS=(,-),31:39,12,PD,ZD,EDIT=TTTTTT.TT,
EDIT=(STTTTTTTTT.TTT),SIGNS=(,-))
then from this position
10amt pic S9(9)V9(2) usage comp-3
10 Dt-amt pIC s9(9)v9(2) USAGE COMP-3.
10 dt-pct pIC s9(1)v9(2) USAGE cOMP-3.
this it shows invalid data in this particular field
and upto
10 Code Pic X(12).
10 No PiC S9(4) comp.
10 model Pic X(10)
this it capture right data but for reamining this
10amt pic S9(9)V9(2) usage comp-3
10 Dt-amt pIC s9(9)v9(2) USAGE COMP-3.
10 dt-pct pIC s9(1)v9(2) USAGE cOMP-3.
it shows invalid data |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
An edited field will not work as comp-3 data. . .
Your post shows comp-3 fields. The code creates edited output.
If all that is needed is packed-decimal (comp-3) why is there any mention of EDIT. . .  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Satish,
Kolusu and I showed you valid various ways to convert or edit your data. But you come back and show invalid statements again. How do you expect us to help you if you ignore what we say?
If you can't show us exactly what your input data looks like and exactly what you want your output data to look like, we can't help you. |
|
| Back to top |
|
 |
santosh100678
New User
Joined: 21 Sep 2009 Posts: 55 Location: Kolkatta
|
|
|
|
Input File :
DELDDCDD1 0020INDIAN 000000000.00999999900.000.05
DELDDCDD1 0028INDIAN 000000000.00999999900.000.05
DELDDCDD1 0193INDIAN 000000000.00999999900.000.05
DELDDCDD1 0197INDIAN 000000000.00999999900.000.05
DELDDCDD1 0198INDIAN 000000000.00999999900.000.05
DELDDCDD1 0220INDIAN 000000000.00999999900.000.05
DELDDCDD1 0223INDIAN 000000000.00999999900.000.05
DELDDCDD1 0292INDIAN 000000000.00999999900.000.05
DELDDCDD1 0699INDIAN 000000000.00999999900.000.05
DELDDCDD1 0714INDIAN 000000000.00999999900.000.05
Position: 1-9 DELDDCDD1
10-12 spaces
13-16 0020
17-22 INDIAN
22-26 spaces
27-38 000000000.00
39-50 999999900.00
51-54 0.05
Now I convert this file in this fomat
01lang
10 Code PIC X(12).
10 No PIC S9(4) comp.
10 Model PIC X(10)
10 AMT PIC S9(9)V9(2) usage comp-3
10 DT-amt PIC s9(9)v9(2) USAGE COMP-3.
10 DT-pct PIC s9(1)v9(2) USAGE COMP-3.
I use this sort Card :
SORT FIELDS=COPY
OUTREC BUILD=(1,12, $ CODE
13,4,ZD,BI,LENGTH=2, $ NO
15,10, $ MODEL
25,11,UFF,PD,LENGTH=6, $ AMT
36,11,UFF,PD,LENGTH=6, $ DT-AMT
47,04,UFF,PD,LENGTH=2) $ DT-PCT
My Job ran successfully and also its shows valid data in file but there is problem in DT_PCT it capture data but not exact
Correct data Could you please see my sort card and guide me any thing wrong and also I want to know when we use
UEF and what is the use of UEF |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
santosh100678,
Your topic title is quite misleading. All you wanted to do is converted readable edited data to comp(binary) and comp-3 (packed decimal fields).
Btw it is UFF format not UEF format. you can read all about UFF/SFF formats here
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000088
use the following JCL which will give you the desired results
| Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
----+----1----+----2----+----3----+----4----+----5----+
DELDDCDD1 0020INDIAN 000000000.00999999900.000.05
DELDDCDD1 0028INDIAN 000000000.00999999900.000.05
DELDDCDD1 0193INDIAN 000000000.00999999900.000.05
DELDDCDD1 0197INDIAN 000000000.00999999900.000.05
DELDDCDD1 0198INDIAN 000000000.00999999900.000.05
DELDDCDD1 0220INDIAN 000000000.00999999900.000.05
DELDDCDD1 0223INDIAN 000000000.00999999900.000.05
DELDDCDD1 0292INDIAN 000000000.00999999900.000.05
DELDDCDD1 0699INDIAN 000000000.00999999900.000.05
DELDDCDD1 0714INDIAN 000000000.00999999900.000.05
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1,12, $ CODE
13,4,ZD,BI,LENGTH=2, $ NO
17,10, $ MODEL
27,12,UFF,PD,LENGTH=6, $ AMT
39,12,UFF,PD,LENGTH=6, $ DT-AMT
51,04,UFF,PD,LENGTH=2) $ DT-PCT
//* |
|
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|