Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1226
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: 1226
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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts Sort two file having same field, one ... himanshu malik DFSORT/ICETOOL 7 Thu Feb 02, 2017 10:09 am
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us