Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Want to string a series of fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Wed Sep 20, 2006 8:15 pm    Post subject: Want to string a series of fields
Reply with quote

icon_rolleyes.gif icon_rolleyes.gif

i need help please......i can't do it.....

i want to string a series of fields.....but not function well...

1) at the first example, de action is: complete all field with caracter '?'
2) if i change with:
' ' DELIMITED BY ' ' complete with blank a total of field en string
3) if ia change with
' ' DELIMITED BY ' '(two blank) the same....

i want to look like this:

' OK?3601?00000?FTPE?0?01?04200?2?3'



move 1 to AUX-LENG-MSG
STRING
S-OK-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
RE-NROMEN-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
RE-RETORNO-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
S-TRAN-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
RE-HAY-MAS-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
RE-CANT-OCCUR-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
S-TABLA-3601(1:S-CANT-OCCUR-3601) DELIMITED
'?' DELIMITED BY '?'
RE-BOTONES-3601 DELIMITED BY SIZE
'?' DELIMITED BY '?'
INTO AREA-MENS-SALIDA
POINTER AUX-LENG-MSG

field definition:

01 AREA-MENS-SALIDA.
05 S-OK-3601 PIC X(5) VALUE SPACES.
05 S-NROMEN-3601 PIC 9(4).
05 RE-NROMEN-3601 REDEFINES S-NROMEN-3601 PIC X(4).
05 S-RETORNO-3601 PIC 9(5).
05 RE-RETORNO-3601 REDEFINES S-RETORNO-3601 PIC X(5).
05 S-TRAN-3601 PIC X(4).
05 S-HAY-MAS-3601 PIC 9.
05 RE-HAY-MAS-3601 REDEFINES S-HAY-MAS-3601 PIC X.
05 S-CANT-OCCUR-3601 PIC 9(2).
05 RE-CANT-OCCUR-3601 REDEFINES S-CANT-OCCUR-3601 PIC XX.
05 S-TABLA-3601.
07 S-LINEA-DETALLE OCCURS 25.
09 COD-OF-GRU-RICS8705 PIC 9(5).
09 RE-COD-OF-GRU-RICS8705 REDEFINES
COD-OF-GRU-RICS8705 PIC X(5).
09 filler PIC X value spaces.
09 I-ESTG2180-RICS8705 PIC 9.
09 filler PIC X value spaces.
09 IND-SUC-OL-RICS8705 PIC 9.
09 filler PIC X value spaces.
05 S-BOTONES-3601 PIC 9.
05 RE-BOTONES-3601 REDEFINES S-BOTONES-3601 PIC X .
Back to top
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed Sep 20, 2006 8:39 pm    Post subject:
Reply with quote

I think you should use:
Code:
STRING
    S-OK-3601 DELIMITED BY SPACE
    '?' DELIMITED BY SIZE
    RE-NROMEN-3601 DELIMITED BY SIZE
    '?' DELIMITED BY SIZE

and so on.
The 1st field has a size of 5 but contains in the example only 2 characters, so it should be DELIMITED BY SPACE
The literal '?' can only be DELIMITED BY SIZE, which is 1.
All other variables are numeric so they have to be DELIMITED BY SIZE as well.
Back to top
View user's profile Send private message
grabeva

New User


Joined: 07 Sep 2006
Posts: 23

PostPosted: Wed Sep 20, 2006 8:54 pm    Post subject: Re: STRING.......(need help!!!
Reply with quote

its no ok....look it...

01 AREA-MENS-SALIDA PIC X(272) ADDR 187
VALUE > OK????????????????????????0?00000?0?0?00000?0?0
+50 > ?00000?0?0?00000?0?0?00000?0?0?00000?0?0?00000?0?0
+100 > ?00000?0?0?00000?0?0?00000?0?0?00000?0?0?00000?0?0
+150 > ?00000?0?0?00000?0?0?00000?0?0?00000?0?0?00000?0?0
+200 > ?00000?0?0?00000?0?0?00000?0?0?00000?0?0?00000?0?0
+250 > ?00000?0?0?00000?0?0?0 <

complete all the first field with '?'

with this code:(look that the first field i need to see ' OK' with 3 blanks before....for that i write delimited by size.
STRING
S-OK-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
lo incluye
'?' DELIMITED BY '?'
' ' DELIMITED BY ' '
RE-NROMEN-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
RE-RETORNO-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
S-TRAN-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
RE-HAY-MAS-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
RE-CANT-OCCUR-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
S-TABLA-3601(1:S-CANT-OCCUR-3601) DELIMITED BY SIZE
'?' DELIMITED BY size
RE-BOTONES-3601 DELIMITED BY SIZE
'?' DELIMITED BY size
INTO AREA-MENS-SALIDA
POINTER AUX-LENG-MSG
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Thu Sep 21, 2006 3:22 pm    Post subject:
Reply with quote

I'm not sure what you mean by:
Quote:
lo incluye
'?' DELIMITED BY '?'
' ' DELIMITED BY ' '

You should try piece by piece. Try first:
Code:
STRING
    S-OK-3601 DELIMITED BY SIZE
    '?' DELIMITED BY size
    RE-NROMEN-3601 DELIMITED BY SIZE
    '?' DELIMITED BY size
    INTO AREA-MENS-SALIDA
If the result is OK add more fields.
When you reach S-TABLA-3601(1:S-CANT-OCCUR-3601) DELIMITED BY SIZE be specially careful,
I'm not sure how COBOL will compute the size of this field
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us