Nova postagem

Pesquisar

Pergunta
· Jun. 25, 2024

How to send WRITE formatted output to a variable

I'm trying to keep all writes in local memory.

If you have    S %A="""HI THERE"",!,#,33.33,"" "",$ZTIMESTAMP"

and you         O 2 U 2 W @%A C 2 ZW ^SPOOL                    
^SPOOL(1,1)="HI THERE"_$c(13,10)
^SPOOL(1,2)=$c(13,12)
^SPOOL(1,3)="33.33 67016,59246.6188873"

It works just fine and the output is in the ^SPOOL global. 

However, I'm trying to avoid writing to disk.

I can't find anything besides using the SPOOL device that will allow the use of the "@" indirection.

I tried using streams but it will not allow @indirection.  Neither will set, or execute, or anything.

Is there any easy way to just set a variable to the formatted write output that the @indirection creates??

Thanks!

4 Comments
Discussão (4)2
Entre ou crie uma conta para continuar
Pergunta
· Jun. 25, 2024

SQL DatePart Not Working With ISO 8601 Formatted Date & Time

Given a properly formatted ISO 8601 date time of 2024-06-23T06:03:00Z using SQL DatePart results in an error:

  [SQLCODE: <-400>:<Fatal error occurred>]

  [%msg: <Invalid input to DATEPART() function: datepart='ss', datetime value='2024-06-23T06:03:00Z')>]

If I remove the trailing Z (for Zulu / UTC time) and leave the T, DatePart works fine.

I have also tried various ± offsets from UTC e.g. +0400 and that also results in the same SQL error

I can Trim the trailing "Z", but I would hope that DatePart would work with an acceptably formatted ISO 8601 date time string without having to go through the machinations of trimming the data.

Any help or suggestions on how to use SQL DatePart with ISO 8601 formatted Date Time strings would be appreciated.

This is the query I was experimenting with:

select 'YEAR: '||DATEPART(YEAR,'2024-06-23T06:03:00Z') 
UNION
select 'MONTH: '||DATEPART(MONTH,'2024-06-23T06:03:00Z') 
UNION
select 'DAY: '||DATEPART(DAY,'2024-06-23T06:03:00Z')
UNION
select 'HOUR: '||DATEPART(HOUR,'2024-06-23T06:03:00Z')
UNION 
select 'MINUTE: '||DATEPART(MINUTE,'2024-06-23T06:03:00Z')
UNION
select 'SECOND: '||DATEPART(SECOND,'2024-06-23T06:03:00Z')

2 Comments
Discussão (2)2
Entre ou crie uma conta para continuar
Pergunta
· Jun. 25, 2024

How can i see the request size in kilobytes/megabytes?

I need to be able to take the size of the request from a given %CSP.request

however it seems the best the docs suggest is to get the length of characters in  the request (using $order and Get, Count)...
this is not good enough for what I need to do, Any suggestions?
I scanned the docs and couldn't find anything.

5 Comments
Discussão (5)1
Entre ou crie uma conta para continuar
Pergunta
· Jun. 25, 2024

How to remove line feed and carriage return from start and end, but not from the middle of a string

Hello,

Thanks for reading this question.

We need to remove the line feeds and carriage returns from start and end, but not from the middle of a string

We have tested the following ways:

set output = $ZStrip("[line feed](carriage return) str [line feed](carriage return) ing [line feed](carriage return)","<>C")

But it removes also control characters which we need to preserve...

Also we have tested:

set output = $REPLACE("[line feed](carriage return) str [line feed](carriage return) ing [line feed](carriage return)",$C(13,10),"")

But it deletes line feed and carriage return at the middle of the string, so it is not what we need...

How would you recommend us to implement it.

We have read:

https://community.intersystems.com/post/trimming

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

https://community.intersystems.com/post/zstrip-clean-string

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls...

 

Could you help us please?

Thanks.

7 Comments
Discussão (7)3
Entre ou crie uma conta para continuar
Anúncio
· Jun. 25, 2024

InterSystems Developer Ecosystem Spring News 2024

Hello and welcome to the Developer Ecosystem Spring News!

This spring was full of online and offline activities in the InterSystems Developer Ecosystem. In case you missed something, we've prepared for you a selection of the hottest news and topics to catch up on!

News

💡 InterSystems Ideas News #12 and #13

📝 Deprecation: InterSystems Public Key Infrastructure (PKI)

🛑 Alert: SQL Query using “NOT %INLIST” fails to return results

🛑 Apr. 8, 2024 – Alert: Upgrades fail for HealthShare® Health Connect instances not licensed for HL7® FHIR®

 Mar.19, 2024 - Advisory: AIX Memory Leak

 May 30, 2024 – Advisory: License Enforcement Changes – REST and SOAP

📝 InterSystems IRIS & IRIS for Health 2024.2 Developer preview update

📝 Windows upgrade removes Studio in 2024.2

📝 InterSystems Platforms Update Q2-2024

😭 The Global Masters Program will be temporarily PAUSED from April 26th

Contests & Events

 
Code Golf

⏯️ [Webinar in Hebrew] Maximize Your Success with InterSystems Support

⏯️ [Webinar in Hebrew] Introducing InterSystems Cloud Services

⏯️ [Webinar in Spanish] SMART on FHIR, extending the capabilities of HealthShare

🧑‍🤝‍🧑 InterSystems Developer Community Roundtable - March 5, 2024

🧑‍🤝‍🧑 InterSystems Developer Community Roundtable - March 26, 2024

🧑‍🤝‍🧑 InterSystems Online Developer Roundtable - April 25, 2024

🤝 Developer Meetup in Boston, March 27

🤝 Developer Meetup in Boston, April 24

👨‍💻 [Hackathon] InterSystems at MIT GrandHack 2024

👥 [Conference] J On The Beach

🚰 [Water Cooler Talk] Is ChatGPT effective in providing ObjectScript guide?

✍ The 3rd edition of the InterSystems Technical Article Contest in Spanish

Latest Releases

⬇️ InterSystems announces General Availability of InterSystems IRIS 2024.1

⬇️ InterSystems announces InterSystems IRIS 2024.1.0.267.2, includes support for Ubuntu 24.04

⬇️ InterSystems announces General Availability of InterSystems IRIS for Health, and HealthShare Health Connect 2024.1

 
⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2024.1 developer previews
 
⬇️ InterSystems IRIS, IRIS for Health, & HealthShare Health Connect 2024.2 developer previews

Best Practices & Key Questions

❓ Key Questions of Winter 2023/2024: March, April, May

People and Companies to Know About 

🌟 Global Masters of Winter 2023/2024: March, April

👨‍💻 Celebrating a True Pillar of the Developer Community: A Journey of Dedication and Expertise

Job Opportunities

💼 HealthShare & IRIS Expertise wanted - Swiss based job opportunity

💼 Contract Job Opportunities?

💼 IRIS Engineer

💼 InterSystems Developer Job opportunity at Virtusa

💼 Software Engineer- IRIS

💼 Intersystems - Cache Objects Health Share Application Developer

💼 IRIS Developer/Support engineer opportunity

💼 InterSystems HealthShare Developer

And more

❗ How to showcase your Credly Badges

❗ How to manage subscriptions on InterSystems Ideas

So...

Here is our take on the most interesting and important things! 

What were your highlights from this past season? Share them in the comments section and let's remember the fun we've had!

Discussão (0)2
Entre ou crie uma conta para continuar